This documentation is archived and is not being maintained.

IDataParameter.SourceColumn Property

Gets or sets the name of the source column that is mapped to the DataSet and used for loading or returning the Value.

[Visual Basic]
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);

Property Value

The name of the source column that is mapped to the DataSet. The default is an empty string.

Remarks

The link betwen the value of the IDataParameter and the DataTable may be bidirectional depending on the value of the Direction property.

Example

[Visual Basic, C#, C++] The following example creates an instance of the implementing class, SqlParameter, and sets some of its properties.

[Visual Basic] 
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] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

IDataParameter Interface | IDataParameter Members | System.Data Namespace

Show: