クエリ テキスト、SqlConnection、および SqlTransaction を指定して、SqlCommand クラスの新しいインスタンスを初期化します。
名前空間: System.Data.SqlClient
アセンブリ: System.Data (system.data.dll 内)
構文
'宣言
Public Sub New ( _
cmdText As String, _
connection As SqlConnection, _
transaction As SqlTransaction _
)
'使用
Dim cmdText As String
Dim connection As SqlConnection
Dim transaction As SqlTransaction
Dim instance As New SqlCommand(cmdText, connection, transaction)
public SqlCommand (
string cmdText,
SqlConnection connection,
SqlTransaction transaction
)
public:
SqlCommand (
String^ cmdText,
SqlConnection^ connection,
SqlTransaction^ transaction
)
public SqlCommand (
String cmdText,
SqlConnection connection,
SqlTransaction transaction
)
public function SqlCommand (
cmdText : String,
connection : SqlConnection,
transaction : SqlTransaction
)
パラメータ
- cmdText
クエリ テキスト。
- connection
SQL Server のインスタンスへの接続を表す SqlConnection。
- transaction
SqlCommand の実行対象の SqlTransaction。
解説
SqlCommand のインスタンスの初期プロパティ値を次の表に示します。
プロパティ |
初期値 |
---|---|
cmdText |
|
30 |
|
CommandType.Text |
|
connection パラメータの値である新しい SqlConnection。 |
これらのパラメータの値は、関連するプロパティを設定することによって変更できます。
プラットフォーム
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0
.NET Compact Framework
サポート対象 : 2.0、1.0
参照
関連項目
SqlCommand クラス
SqlCommand メンバ
System.Data.SqlClient 名前空間
その他の技術情報
ADO.NET でのデータへの接続およびデータの取得
.NET Framework Data Provider for SQL Server の使用