Send feedback on this topic.
Teradata.Client.Provider
SourceVersion Property
Example 



Teradata.Client.Provider Namespace > TdParameter Class : SourceVersion Property
Gets or sets the DataRowVersion to use when loading a DataTable column into the TdParameter object.
Syntax
'Declaration
 
Public Overrides NotOverridable Property SourceVersion As DataRowVersion
'Usage
 
Dim instance As TdParameter
Dim value As DataRowVersion
 
instance.SourceVersion = value
 
value = instance.SourceVersion
public override DataRowVersion SourceVersion {get; set;}
public:
property DataRowVersion SourceVersion {
   DataRowVersion get() override;
   void set (    DataRowVersion value) override;
}

Property Value

One of the System.Data.DataRowVersion enumeration values. The default is Current.
Exceptions
ExceptionDescription
Argument is not a valid DataRowVersion.
Remarks
The TdDataAdapter.Update method uses this value to determine the corresponding DataRow column value to be assigned to the TdParameter.Value property. Usually the parameters passed to the WHERE clause of the SQL statement assigned to the TdDataAdapter.UpdateCommand property carry the Original values. Original values are used to identify the row.
Example
The following example creates a TdCommand which is used as a TdDataAdapter.UpdateCommand property. The first parameter is set to Current while the second parameter is set to Original. In this case, CustomerID uniquely identifies the row.
public TdCommand GetUpdateCommand()
{
    TdCommand cmd = new TdCommand();
    cmd.CommandText = "UPDATE Customer SET Status = ? WHERE CustomerID = ?";
            
    TdParameter status = new TdParameter("STATUS", TdType.Char, 1);
    status.SourceColumn = "STATUS";
    status.SourceVersion = SourceVersion.Current;
    cmd.Add(status);
            
    TdParameter customerId = new TdParameter("CUSTOMERID", TdType.Char, 10);
    customerId.SourceColumn = "CUSTOMERID";
    customerId.SourceVersion = SourceVersion.Original;
    cmd.Add(customerId);
            
    return cmd;
}
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdParameter Class
TdParameter Members