Language

SqlConnectionFactory.CreateConnection(String) メソッド

定義

指定されたデータベース名または接続文字列に基づいて、SQL Serverの接続を作成します。 指定された文字列に '=' 文字が含まれている場合、完全な接続文字列として扱われ、それ以外の場合はデータベース名としてのみ扱われます。

public System.Data.Common.DbConnection CreateConnection(string nameOrConnectionString);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
public System.Data.Common.DbConnection CreateConnection(string nameOrConnectionString);
abstract member CreateConnection : string -> System.Data.Common.DbConnection
override this.CreateConnection : string -> System.Data.Common.DbConnection
Public Function CreateConnection (nameOrConnectionString As String) As DbConnection

パラメーター

nameOrConnectionString
String

データベース名または接続文字列。

戻り値

初期化された DbConnection。

実装

属性

適用対象