Executes and ad-hoc SQL statement that does not return a record set.
Namespace:
DbNetLink.DataAssembly: DbNetLink.DbNetData (in DbNetLink.DbNetData.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public int ExecuteNonQuery( string Sql ) |
| Visual Basic (Declaration) |
|---|
Public Function ExecuteNonQuery ( _ Sql As String _ ) As Integer |
| Visual C++ |
|---|
public: int ExecuteNonQuery( String^ Sql ) |
Parameters
- Sql
- Type: System..::.String
The insert statement or table name
Return Value
Returns the number of rows affected
Examples
DbNetData Db = new DbNetData( ConfigurationManager.ConnectionStrings["nwind"] ); Db.Open(); Db.ExecuteNonQuery("drop table products") Db.Close();