Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
初始化 SAConnection 对象。
Public Sub New(ByVal connectionString As String)
public SAConnection(string connectionString)
connectionString 一个 SQL Anywhere 连接字符串。连接字符串是以分号分隔的 "关键字=值" 对的列表。有关连接参数的列表,请参见连接参数。
随后必须打开该连接,才能对数据库执行任何操作。
以下语句为到名为 policies 的数据库的连接初始化一个 SAConnection 对象,该数据库在名为 hr 的 SQL Anywhere 数据库服务器上运行。该连接使用的用户 ID 为 admin,口令为 money。
SAConnection conn = new SAConnection( "UID=admin;PWD=money;SERVER=hr;DBN=policies" ); conn.Open();