ADO.NET ExecuteNonQuery in OleDbCommand Object
The ExecuteNonQuery() method in the OleDbCommand Object is indeed one of the commonly used methods for executing statements that do not return a result set. It is particularly useful for performing data definition and data manipulation tasks within the database.
Similar to its usage in the SqlCommand Object, ExecuteNonQuery() in the OleDbCommand Object handles data definition tasks such as creating stored procedures and views. By using ExecuteNonQuery(), developers can execute SQL statements that create or modify database objects without expecting any data to be returned. This method enables the efficient execution of data definition tasks, allowing for the creation and modification of stored procedures, views, and other database objects.
ExecuteNonQuery()
The ExecuteNonQuery() is also used for data manipulation tasks, including inserting, updating, and deleting data within the database. It allows developers to execute SQL statements that modify the data without retrieving any result set. This method is especially useful for performing operations that directly affect the data, such as inserting new records, updating existing records, or deleting records from a table.
The following example shows how to use the method ExecuteNonQuery() through OleDbCommand Object.
Full Source VB.NETYou have to replace the string with your realtime variables.
- ADO.NET Connection Object
- ADO.NET SQL Server Connection
- ADO.NET OLEDB Connection
- ADO.NET ODBC Connection
- ADO.NET Command
- ADO.NET ExecuteNonQuery in SqlCommand Object
- ADO.NET ExecuteScalar in SqlCommand Object
- ADO.NET ExecuteScalar in OleDbCommand Object
- ADO.NET ExecuteReader in SqlCommand Object
- ADO.NET ExecuteReader in OleDbCommand Object
- How to ADO.NET DataReader
- How to ADO.NET SqlDataReader
- How to ADO.NET OleDbDataReader
- How to Multiple Result Sets in ADO.NET
- Getting Schema Informations from SqlDataReader
- Getting Schema Informations from OleDbDataReader
- What is DataAdapter
- What is SqlDataAdapter
- What is OleDbDataAdapter
- Vb.NET ExecuteReader and ExecuteNonQuery