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 同步逻辑

 

第 5 课:使用 -sl dnet 运行 MobiLink 服务器

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

在本课中,您将使用 -sl dnet 选项运行 MobiLink 服务器,以指定 .NET 程序集的位置,并强制在服务器启动时装载 CLR。

如果使用 Visual Studio 进行编译,则 CustdbScripts.dll 的位置为 c:\mldotnet\CustdbScripts\CustdbScripts\bin\Debug。如果在命令提示符处进行编译,则 CustdbScripts.dll 的位置为 c:\mldotnet

 ♦ 启动 MobiLink 服务器 (mlsrv12) 并装载 .NET 程序集
  1. 带 -sl dnet 选项启动 MobiLink 服务器。

    如果使用 Visual Studio 编译程序集,请运行以下命令:

    mlsrv12 -c "DSN=SQL Anywhere 12 CustDB" -dl -o c:\mldotnet\cons1.txt -v+ -sl dnet(-MLAutoLoadPath=c:\mldotnet\CustdbScripts\CustdbScripts\bin\Debug)

    如果在命令提示符中编译程序集,请运行以下命令:

    mlsrv12 -c "DSN=SQL Anywhere 12 CustDB" -dl -o c:\mldotnet\cons1.txt -v+ -sl dnet(-MLAutoLoadPath=c:\mldotnet)

    将出现一条消息,指明服务器已准备好处理请求。如果同步过程中触发了 upload_insert 事件,则会执行 .NET 方法。

  2. 前进至第 6 课:测试同步

 另请参见