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!

SQLDataSetCommand.DeleteCommand

Gets or sets a command to delete records from the data set.

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

Property Value

A SQLCommand used during Update to delete records in the data source of deleted rows in the data set.

Example [Visual Basic]

The following example creates a SQLCommand used to set the DeleteCommand property to be used by the SQLDataSetCommand.

[Visual Basic]

Sub AssignDeleteCommand ()
   Dim myConnection As SQLConnection
   Dim sqlDataSetComm As SQLDataSetCommand
   Dim myConnectStr As String
   Dim myDelComm As String
   ' Initialize the SQLDataSetCommand
   sqlDatSetComm = New SQLDataSetCommand
   ' Assign myConnectStr to the connection string
   myConnectStr = "Provider=SQLSQL.1;User ID=sa;PASSWORD=;" _
    + "Initial Catalog=Northwind;Data Source=vbsql7;"
   ' Initialize the SQLConnection
   myConnection = New SQLConnection myConnectStr
   ' Assign myDelComm to the text of my delete command
   myDelComm = "DELETE FROM tblCustomer WHERE intID = ?"
   ' Assign the DeleteCommand to myDelComm
   sqlDataSetComm.DeleteCommand.CommandText = myDelComm
   ' Set the command's connection to the current connection
   Set sqlDataSetComm.DeleteCommand.ActiveConnection = myConnection
End Sub

See Also

SQLDataSetCommand Class | SQLDataSetCommand Members | System.Data.SQL Namespace | InsertCommand | SelectCommand | UpdateCommand