NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ADODataSetCommand.DeleteCommand

Gets or sets a command for deleting records from the data set.

[Visual Basic]
Public Property DeleteCommand As ADOCommand
[C#]
public ADOCommand DeleteCommand {get; set;}
[C++]
public: __property ADOCommand* get_DeleteCommand();
public: __property void set_DeleteCommand(ADOCommand*);
[JScript]
public function get DeleteCommand() : ADOCommand;
public function set DeleteCommand(ADOCommand);

Property Value

An ADOCommand used during Update to delete records in the data source for deleted rows in the data set.

Example [Visual Basic]

The following example creates an ADOCommand used to set the DeleteCommand property for use by the ADODataSetCommand.

[Visual Basic]

Sub AssignDeleteCommand ()
   Dim myConnection As ADOConnection
   Dim adoDataSetComm As ADODataSetCommand
   Dim myConnectStr As String
   Dim myDelComm As String
   ' Initialize the ADODataSetCommand
   adoDatSetComm = 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 myDelComm to the text of my delete command
   myDelComm = "DELETE FROM tblCustomer WHERE intID = ?"
   ' Assign the DeleteCommand to myDelComm
   adoDataSetComm.DeleteCommand.CommandText = myDelComm
   ' Set the command's connection to the current connection
   Set adoDataSetComm.DeleteCommand.ActiveConnection = myConnection
End Sub

See Also

ADODataSetCommand Class | ADODataSetCommand Members | System.Data.ADO Namespace | InsertCommand | SelectCommand | UpdateCommand