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

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - 编程 » SQL Anywhere 数据访问 API » SQL Anywhere ASP.NET 提供程序

 

注册连接字符串

有两种方法注册连接字符串:

  • 在 ODBC 数据源管理器中注册 ODBC 数据源,并通过名称进行引用。

  • 指定完整的 SQL Anywhere 连接字符串。例如:

    connectionString="ENG=MyServer;DBN=MyDatabase;UID=DBA;PWD=sql"

<connectionStrings> 元素添加到 web.config 文件时,连接字符串及其提供程序可以被应用程序引用。可以在单个位置上实现更新。

注册连接字符串的 XML 代码示例
<connectionStrings>
   <add name="MyConnectionString" 	
      connectionString="DSN=MyDataSource" 	
      providerName="iAnywhere.Data.SQLAnywhere"/>
</connectionStrings>