Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (中文) » QAnywhere » 编写 QAnywhere 客户端应用程序 » 初始化 QAnywhere API

 

设置 .NET 应用程序

使用 QAnywhere .NET 客户端发送或接收消息之前,必须完成以下初始化任务。

Visual Studio 项目必须进行两项更改后才能使用:

  • 添加对 QAnywhere .NET DLL 的引用。添加引用可通知 Visual Studio .NET 包含哪个 DLL,以找到 QAnywhere .NET API 的代码。

  • 在源代码中添加一行以引用 QAnywhere .NET API 类。要使用 QAnywhere .NET API,您必须在源代码中添加一行以引用数据提供程序。必须为 C# 添加与 Visual Basic .NET 不同的语句行。

此外,您还必须初始化 QAnywhere .NET API。

 ♦  在 Visual Studio 项目中添加对 QAnywhere .NET API 的引用
  1. 启动 Visual Studio 并打开项目。

  2. 在 [Solution Explorer] 窗口中,右击 [References] 文件夹,然后选择 [Add Reference]。

  3. 在 [.NET] 选项卡上,单击 [Browse] 来查找 iAnywhere.QAnywhere.Client.dll。缺省位置为:

    • .NET Framework 2.0:install-dir\Assembly\V2
    • .NET Compact Framework 2.0:install-dir\ce\Assembly\V2

    选择 DLL 然后单击 [Open]。

  4. 可以验证 DLL 是否已添加到项目中。打开 [Add Reference] 窗口然后单击 [.NET] 选项卡。随即 iAnywhere.QAnywhere.Client.dll 出现在 [Selected Components] 列表中。单击 [OK] 关闭窗口。

 在源代码中引用数据提供程序类
 另请参见