Deletes record from the table using the supplied parameterised statement and parameter values
Namespace:
DbNetLink.DataAssembly: DbNetLink.DbNetData (in DbNetLink.DbNetData.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public long ExecuteDelete( string Sql, IDictionary Params ) |
| Visual Basic (Declaration) |
|---|
Public Function ExecuteDelete ( _ Sql As String, _ Params As IDictionary _ ) As Long |
| Visual C++ |
|---|
public: long long ExecuteDelete( String^ Sql, IDictionary^ Params ) |
Parameters
- Sql
- Type: System..::.String
The parameterised delete statement or table name
- Params
- Type: System.Collections..::.IDictionary
The paramater values
Return Value
Returns the number of records deleted
Examples
DbNetData Db = new DbNetData( ConfigurationManager.ConnectionStrings["nwind"] ); Db.Open(); Params = new ListDisctionary(); Params["discontinued"] = 1; Db.ExecuteDelete("products", Params) // 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 Db.Close();