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

SQL Anywhere 12.0.1 » MobiLink - 入门 » MobiLink 教程 » 教程:使用 .NET 同步逻辑

 

第 4 课:为事件指定类方法

本课假定您已完成前面的所有课程。 请参见第 1 课:利用 MobiLink 参考编译 CustdbScripts.dll 程序集

上一课中创建的 CustdbScripts.dll 类封装了 UploadInsert 和 DownloadCursor 方法。这些方法分别包含 ULCustomer upload_insert 和 download_cursor 事件的实现。

在本课中,您将通过 Interactive SQL 连接到 CustDB 数据库并运行 ml_add_dnet_table_script,从而为 download_cursor 事件指定 MLExample.CustdbScripts.DownloadCursor。

 ♦ 为 ULCustomer download_cursor 事件指定 MLExample.CustdbScripts.DownloadCursor
  1. 从 Interactive SQL 连接到示例数据库。

    1. 单击 [开始] » [程序] » [SQL Anywhere 12] » [管理工具] » [Interactive SQL],或运行以下命令:

      dbisql
    2. 单击 [ODBC 数据源名称],然后键入 SQL Anywhere 12 CustDB

    3. 单击 [连接]。

  2. 在 Interactive SQL 中执行以下 SQL 语句,以指定处理 ULCustomer 表级事件的 .NET 方法:

    CALL ml_add_dnet_table_script(
        'custdb 12.0',
        'ULCustomer',
        'download_cursor',
        'MLExample.CustdbScripts.DownloadCursor');
    COMMIT;

    以下是对每个参数的说明:

    参数 说明
    custdb 12.0 脚本版本。
    ULCustomer 同步表。
    download_cursor 事件名。
    MLExample.CustdbScripts.DownloadCursor 完全限定 .NET 方法。
    注意

    更新的 download_cursor 脚本可能不会出现在 Sybase Central 中。要在 Sybase Central 中查看 MobiLink 项目的最新更改,请单击 [视图] » [全部刷新]。

  3. 关闭 Interactive SQL。

  4. 前进至第 5 课:使用 -sl dnet 运行 MobiLink 服务器

 另请参见