OdbcParameter.SourceVersion 属性

定义

获取或设置在加载 DataRowVersion 时使用的 ValueGets or sets the DataRowVersion to use when you load Value.

public:
 virtual property System::Data::DataRowVersion SourceVersion { System::Data::DataRowVersion get(); void set(System::Data::DataRowVersion value); };
public:
 property System::Data::DataRowVersion SourceVersion { System::Data::DataRowVersion get(); void set(System::Data::DataRowVersion value); };
public override System.Data.DataRowVersion SourceVersion { get; set; }
public System.Data.DataRowVersion SourceVersion { get; set; }
member this.SourceVersion : System.Data.DataRowVersion with get, set
Public Overrides Property SourceVersion As DataRowVersion
Public Property SourceVersion As DataRowVersion

属性值

DataRowVersion 值之一。One of the DataRowVersion values. 默认值为 Current。The default is Current.

实现

示例

下面的示例创建一个 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"  
    parameter.SourceVersion = DataRowVersion.Current  
End Sub   
public void CreateOdbcParameter()   
 {  
    OdbcParameter parameter = new OdbcParameter("Description", OdbcType.VarChar, 88);  
    parameter.SourceColumn = "Description";  
    parameter.SourceVersion = DataRowVersion.Current;  
 }  

注解

Update 操作期间 UpdateCommand 使用 SourceVersion,以确定参数值是设置为 "当前" 还是 "原始"。The SourceVersion is used by UpdateCommand during an Update operation to determine whether the parameter value is set to Current or Original. 这允许更新主键。This allows primary keys to be updated.

此属性设置为 Item 属性(DataRow 索引器)或 GetChildRows 方法使用的 DataRow 版本。This property is set to the version of the DataRow used by either the Item property (DataRow indexer), or the GetChildRows method.

适用于

另请参阅