DB2Parameter.SourceVersion Property
Gets or sets the DataRowVersion to use when loading Value.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
Public Property SourceVersion As DataRowVersion Implements _
IDataParameter.SourceVersion
[C#]
public DataRowVersion SourceVersion {get; set;}
[C++]
public: __property DataRowVersion get_SourceVersion();
public: __property void set_SourceVersion(DataRowVersion);
[JScript]
public function get SourceVersion() : DataRowVersion;
public function set SourceVersion(DataRowVersion);
- Implements:
- IDataParameter.SourceVersion
Property value
One of the System.Data.DataRowVersion values. The default is Current.
Exceptions
Exception type | Condition |
---|---|
ArgumentException | The property was not set to one of the DataRowVersion values. |
Remarks
The SourceVersion is used by DB2®DataAdapter.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 ignored by DB2DataAdapter.InsertCommand and DB2DataAdapter.DeleteCommand.
This property is set to the version of the DataRow used by either the Item property (DataRow indexer), or the GetChildRows method of the DataRow object.
Example
[Visual Basic, C#] The following example creates a DB2Parameter and sets some of its properties.
[Visual Basic]
Public Sub CreateDB2Parameter()
Dim myParameter As New DB2Parameter("Description", DB2Type.VarChar, 88)
myParameter.SourceColumn = "Description"
myParameter.SourceVersion = DataRowVersion.Current
End Sub 'CreateDB2Parameter
[C#]
public void CreateDB2Parameter()
{
DB2Parameter myParameter = new DB2Parameter("Description", DB2Type.VarChar, 88);
myParameter.SourceColumn = "Description";
myParameter.SourceVersion = DataRowVersion.Current;
}