Executes and ad-hoc SQL statement that does not return a record set.
| C# | Visual Basic |
public int ExecuteNonQuery( string Sql, IDictionary Params, bool IgnoreErrors )
Public Function ExecuteNonQuery ( _ Sql As String, _ Params As IDictionary, _ IgnoreErrors As Boolean _ ) As Integer
- Sql (String)
-
The insert statement or table name
- Params (IDictionary)
-
Parameter values collection
- IgnoreErrors (Boolean)
-
Suppress any encountered errors
Returns the number of rows affected
DbNetData Data = new DbNetData( ConfigurationSettings.AppSettings[ "nwind" ] ); Data.Open(); Data.ExecuteNonQuery("drop table products", null, true) Data.Close();