Gets or sets a command used to update records in the data source.
[Visual Basic] Public Property UpdateCommand As ADOCommand [C#] public ADOCommand UpdateCommand {get; set;} [C++] public: __property ADOCommand* get_UpdateCommand(); public: __property void set_UpdateCommand(ADOCommand*); [JScript] public function get UpdateCommand() : ADOCommand; public function set UpdateCommand(ADOCommand);
An ADOCommand used during Update to update records in the data source for modified rows in the data set.
The following example creates an ADOCommand used to set the UpdateCommand property for use by the ADODataSetCommand.
[Visual Basic]
Sub AssignUpdateCommand () Dim myConnection As ADOConnection Dim myConnectStr As String Dim myUpdateComm As String Dim adoDataSetComm As ADODataSetCommand ' Initialize the ADODataSetCommand adoDataSetComm = New ADODataSetCommand ' Assign myConnectStr to the connection string myConnectStr = "Provider=SQLADO.1;User ID=sa;PASSWORD=;" _ + "Initial Catalog=Northwind;Data Source=vbsql7;" ' Initialize the ADOConnection myConnection = New ADOConnection myConnectStr ' Assign myUpdateComm to the text of my update command myUpdateComm = "DELETE FROM tblCustomer WHERE intID = ?" ' Assign the UpdateCommand to myUpdateComm adoDataSetComm.UpdateCommand.CommandText = myUpdateComm ' Set the command's connection to the current connection Set adoDataSetComm.UpdateCommand.ActiveConnection = myConnection End Sub
ADODataSetCommand Class | ADODataSetCommand Members | System.Data.ADO Namespace | DeleteCommand | InsertCommand | SelectCommand