Deletes record from the table using the supplied CommandConfig

Namespace:  DbNetLink.Data
Assembly:  DbNetLink.DbNetData (in DbNetLink.DbNetData.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public long ExecuteDelete(
	CommandConfig CmdConfig
)
Visual Basic (Declaration)
Public Function ExecuteDelete ( _
	CmdConfig As CommandConfig _
) As Long
Visual C++
public:
long long ExecuteDelete(
	CommandConfig^ CmdConfig
)

Parameters

CmdConfig
Type: DbNetLink.Data..::.CommandConfig

The parameterised delete statement/table name and parameter values

Return Value

Returns the number of records deleted

Examples

CopyC#
DbNetData Db = new DbNetData( ConfigurationManager.ConnectionStrings["nwind"] );
Db.Open();
CommandConfig CmdConfig = new CommandConfig("products");
// You only need to specify the table name. DbNetData will build the rest of 
// the delete statement automatically using the parameters to build the where
// clause
CmdConfig.Params["discontinued"] = 1;

Db.ExecuteDelete(CmdConfig)
Db.Close();

See Also