SqlEverywhereDataService.BuildDeleteCommand

Creates a delete command object for the defined table and primary key.

public virtual IDbCommand BuildDeleteCommand( string tableName,
	string primaryKeyFieldName,
	object primaryKeyValue,
	DataRowProcessMethod updateMethod );

Return Value

IDbCommand object that can subsequentially be executed against a database

Parameters

tableName
Name of the table the record is to be deleted from .

primaryKeyFieldName
Primary key field name within the table

primaryKeyValue
Primary key value for the record that is to be deleted

updateMethod
Method used to update the database (commands, stored procedures,...)


Remarks

Whenever this method is called in Stored Procedure mode, there needs to be a Stored Procedure on the server that follows the following naming convention:

[Prefix]del[TableName]

So in a scenario where the default prefix is used and the table name is Customer, the SP needs to have the following name:

milos_delCustomer

The SP needs to accept a single parameter, which defines the primary key value of the row that is to be deleted. The name of the parameter needs to be the same as the primary key field. (If the PK field is named pk_customer, the parameter name is @pk_customer).

See also:

Class SqlEverywhereDataService


  Last Updated: 5/23/2007 | © , 2007