Deletes record from the table using the supplied CommandConfig
| C# | Visual Basic |
public long ExecuteDelete( CommandConfig CmdConfig )
Public Function ExecuteDelete ( _ CmdConfig As CommandConfig _ ) As Long
- CmdConfig (CommandConfig)
-
The parameterised delete statement/table name and parameter values
Returns the number of records deleted
DbNetData Data = new DbNetData( ConfigurationSettings.AppSettings[ "nwind" ] ); Data.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; Data.ExecuteDelete(CmdConfig) Data.Close();