Gets or sets an SQL statement or stored procedure to delete records from the data set.
public AdsCommand DeleteCommand { get; set; }
Remarks
During AdsDataAdapter.Update, if this property is not set and primary key information is present in the DataSet, the DeleteCommand can be generated automatically if you set the SelectCommand property and use the AdsCommandBuilder. Then, any additional commands that you do not set are generated by the AdsCommandBuilder.
When DeleteCommand is assigned to a previously created AdsCommand, the AdsCommand is not cloned. The DeleteCommand maintains a reference to the previously created AdsCommand object.
Note In the WHERE clause of the Delete Command, it is not necessary to check for NULL conditions in the parameters explicitly in the statement. Advantage will correctly handle the comparison for parameters that have a NULL value. In fact, Advantage will not allow a parameter to be on the left-hand side of an operator.
The following is a valid DELETE command for an SqlDataAdapter:
DELETE FROM Sample WHERE ( (ID = @p1) AND ((LastName IS NULL AND @p2 IS NULL) OR (LastName = @p3))
AND ((FirstName IS NULL AND @p4 IS NULL) OR (FirstName = @p5)) )
The anaologous DELETE command for the AdsDataAdapter would look like this:
DELETE FROM Sample WHERE ( (ID = :p1) AND (LastName = :p2) AND (FirstName = :p3) )
See Also