OdbcParameter.SourceColumn 属性

定义

获取或设置源列的名称,该源列映射到 DataSet 并用于加载或返回 ValueGets or sets the name of the source column mapped to the DataSet and used for loading or returning the Value.

public:
 virtual property System::String ^ SourceColumn { System::String ^ get(); void set(System::String ^ value); };
public:
 property System::String ^ SourceColumn { System::String ^ get(); void set(System::String ^ value); };
public override string SourceColumn { get; set; }
public string SourceColumn { get; set; }
member this.SourceColumn : string with get, set
Public Overrides Property SourceColumn As String
Public Property SourceColumn As String

属性值

将用于设置此参数值的源列的名称。The name of the source column that will be used to set the value of this parameter. 默认值为空字符串("")。The default is an empty string ("").

实现

示例

下面的示例创建一个 OdbcParameter 并设置其一些属性。The following example creates an OdbcParameter and sets some of its properties.

Public Sub CreateOdbcParameter()  
    Dim parameter As New OdbcParameter("Description", OdbcType.VarChar, 88)  
    parameter.SourceColumn = "Description"  
End Sub   
public void CreateOdbcParameter()   
 {  
    OdbcParameter parameter = new OdbcParameter("Description", OdbcType.VarChar, 88);  
    parameter.SourceColumn = "Description";  
 }  

注解

如果 SourceColumn 设置为空字符串以外的任何值,则将从具有 SourceColumn 名称的列中检索参数的值。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. 如果 Direction 设置为 Input,则从 DataSet获取值。If Direction is set to Input, the value is taken from the DataSet. 如果 Direction 设置为 Output,则从数据源获取值。If Direction is set to Output, the value is taken from the data source. InputOutputDirection 是两者的组合。A Direction of InputOutput is a combination of both.

有关如何使用 SourceColumn 属性的详细信息,请参阅DataAdapter 参数使用 Dataadapter 更新数据源For more information about how to use the SourceColumn property, see DataAdapter Parameters and Updating Data Sources with DataAdapters.

适用于

另请参阅