SourceColumn Property

OdbcParameter.SourceColumn Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

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

[Visual Basic]
Public Overridable Property SourceColumn As String  Implements _
   IDataParameter.SourceColumn
[C#]
public virtual string SourceColumn {get; set;}
[C++]
public: __property virtual String* get_SourceColumn();
public: __property virtual void set_SourceColumn(String*);
[JScript]
public function get SourceColumn() : String;
public function set SourceColumn(String);

Property Value

The name of the source column that will be used to set the value of this parameter. The default is an empty string ("").

Implements

IDataParameter.SourceColumn

Remarks

When SourceColumn is set to anything other than an empty string, the value of the parameter is retrieved from the column with the SourceColumn name. If Direction is set to Input, the value is taken from the DataSet. If Direction is set to Output, the value is taken from the data source. A Direction of InputOutput is a combination of both.

For more information about using the OdbcParameter property, see Using Parameters with a DataAdapter and Updating the Database with a DataAdapter and the DataSet.

Example

[Visual Basic, C#, C++] The following example creates an SourceColumn and sets some of its properties.

[Visual Basic] 
Public Sub CreateOdbcParameter()
    Dim myParameter As New OdbcParameter("Description", OdbcType.VarChar, 88)
    myParameter.SourceColumn = "Description"
End Sub 'CreateOdbcParameter

[C#] 
public void CreateOdbcParameter() 
 {
    OdbcParameter myParameter = new OdbcParameter("Description", OdbcType.VarChar, 88);
    myParameter.SourceColumn = "Description";
 }

[C++] 
public:
    void CreateOdbcParameter()
    {
        OdbcParameter* myParameter = new OdbcParameter(S"Description", OdbcType::VarChar, 88);
        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

See Also

OdbcParameter Class | OdbcParameter Members | System.Data.Odbc Namespace

Show:
© 2016 Microsoft