次の方法で共有


IDataParameter.SourceColumn プロパティ

DataSet に割り当てられ、 Value を読み込むとき、または戻すときに使用されるソース列の名前を取得または設定します。

Property SourceColumn As String
[C#]
string SourceColumn {get; set;}
[C++]
__property String* get_SourceColumn();__property void set_SourceColumn(String*);
[JScript]
function get SourceColumn() : String;function set SourceColumn(String);

プロパティ値

DataSet に割り当てられるソース列の名前。既定値は空の文字列です。

解説

IDataParameter の値と DataTable の間のリンクは、 Direction プロパティの値によっては双方向の場合があります。

使用例

[Visual Basic, C#, C++] 実装クラスのインスタンス、 SqlParameter を作成し、そのプロパティの一部を設定する例を次に示します。

 
Public Sub CreateSqlParameter()
    Dim myParameter As New SqlParameter("@Description", SqlDbType.VarChar)
    myParameter.IsNullable = True
    myParameter.Direction = ParameterDirection.Output
    myParameter.SourceColumn = "Description"
End Sub 'CreateSqlParameter

[C#] 
public void CreateSqlParameter() 
 {
    SqlParameter myParameter = new SqlParameter("@Description", SqlDbType.VarChar);
    myParameter.IsNullable = true;
    myParameter.Direction = ParameterDirection.Output;
    myParameter.SourceColumn = "Description";
 }

[C++] 
public:
void CreateSqlParameter() 
 {
    SqlParameter* myParameter = new SqlParameter(S"@Description", SqlDbType::VarChar);
    myParameter->IsNullable = true;
    myParameter->Direction = ParameterDirection::Output;
    myParameter->SourceColumn = S"Description";
 }

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

IDataParameter インターフェイス | IDataParameter メンバ | System.Data 名前空間