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 .NET 2.0 API リファレンス » iAnywhere.Data.SQLAnywhere ネームスペース (.NET 2.0) » SAConnection クラス » SAConnection コンストラクタ

 

SAConnection(String) コンストラクタ

SAConnection オブジェクトを初期化します。接続を開いてから、データベース操作を実行してください。

構文
Visual Basic

Public Sub New( _
   ByVal connectionString As String _
)
C#

public  SAConnection(
   string  connectionString
);
パラメータ
  • connectionString   SQL Anywhere 接続文字列。接続文字列は keyword=value のペアがセミコロンで区切られたリストです。

    接続パラメータのリストについては、接続パラメータを参照してください。

次の文は、hr という名前の SQL Anywhere データベース・サーバ上で動作している policies という名前のデータベースへの接続について SAConnection オブジェクトを初期化します。接続では、ユーザ ID admin とパスワード money を使用します。

SAConnection conn = new SAConnection(
"UID=admin;PWD=money;ENG=hr;DBN=policies" );
conn.Open();
参照