This documentation is archived and is not being maintained.

OleDbParameter.SourceVersion Property

Gets or sets the DataRowVersion to use when loading Value.

[Visual Basic]
Public Overridable Property SourceVersion As DataRowVersion  _
   Implements IDataParameter.SourceVersion
public virtual DataRowVersion SourceVersion {get; set;}
public: __property virtual DataRowVersion get_SourceVersion();
public: __property virtual void set_SourceVersion(DataRowVersion);
public function get SourceVersion() : DataRowVersion;
public function set SourceVersion(DataRowVersion);

Property Value

One of the DataRowVersion values. The default is Current.




Exception Type Condition
ArgumentException The property was not set to one of the DataRowVersion values.


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. This property is set to the version of the DataRow used by the Item property, or the GetChildRows method of the DataRow object.


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

[Visual Basic] 
Public Sub CreateOleDbParameter()
    Dim myParameter As New OleDbParameter("Description", OleDbType.VarChar, 88)
    myParameter.SourceColumn = "Description"
    myParameter.SourceVersion = DataRowVersion.Current
End Sub 'CreateOleDbParameter

public void CreateOleDbParameter() 
    OleDbParameter myParameter = new OleDbParameter("Description", OleDbType.VarChar, 88);
    myParameter.SourceColumn = "Description";
    myParameter.SourceVersion = DataRowVersion.Current;

void CreateOleDbParameter() 
    OleDbParameter* myParameter = new OleDbParameter(S"Description", OleDbType::VarChar, 88);
    myParameter->SourceColumn = S"Description";
    myParameter->SourceVersion = DataRowVersion::Current;

[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.


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

OleDbParameter Class | OleDbParameter Members | System.Data.OleDb Namespace