Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
ULCommand.CommandType プロパティが System.Data.CommandType.TableDirect である場合の、SQL 文のテキストまたはテーブルの名前を指定します。
Public Overrides Property CommandText As String
public override string CommandText {get;set;}
パラメーター化された文の場合、疑問符 (?) プレースホルダーを使用してパラメーターを渡します。
SQL 文のテキストまたはテーブルの名前を指定する文字列。デフォルトは、空の文字列 (無効なコマンド) です。
SELECT 文は、パフォーマンス上の理由により、デフォルトで読み込み専用とマーク付けされます。クエリを使用して更新を行う場合、SELECT 文は "FOR UPDATE" で終わる必要があります。
' Visual Basic myCmd.CommandText = "SELECT * FROM Customers WHERE CustomerID = ?"
対応する C# 言語のコードを次に示します。
// C# myCmd.CommandText = "SELECT * FROM Customers WHERE CustomerID = ?";