Deletes record from the table using the supplied parameterised statement and parameter values
| C# | Visual Basic |
public long ExecuteDelete( string Sql, IDictionary Params )
Public Function ExecuteDelete ( _ Sql As String, _ Params As IDictionary _ ) As Long
- Sql (String)
-
The parameterised delete statement or table name
- Params (IDictionary)
-
The paramater values
Returns the number of records deleted
DbNetData Data = new DbNetData( ConfigurationSettings.AppSettings[ "nwind" ] ); Data.Open(); Params = new ListDisctionary(); Params["discontinued"] = 1; Data.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 Data.Close();