asp.net.ph

OleDbCommand Constructor

System.Data.OleDb Namespace   OleDbCommand Class


Initializes a new instance of the OleDbCommand class.

Overload List

1. Initializes a new instance of the OleDbCommand class.

2. Initializes a new instance of the OleDbCommand class with the text of the query.

3. Initializes a new instance of the OleDbCommand class with the text of the query and an OleDbConnection.

4. Initializes a new instance of the OleDbCommand class with the text of the query, an OleDbConnection, and the Transaction.


Example

The following example initializes an OleDbCommand and sets some of its properties.

NOTE: This example uses one of the overloaded versions of the OleDbCommand constructor. For other examples that may be available, see the individual overload topics.

OleDbConnection myConn = new OleDbConnection
   ( "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=Northwind.mdb" );
myConn.Open ( );
OleDbTransaction myTrans = myConn.BeginTransaction ( );
string query = "SELECT * FROM Categories ORDER BY CategoryID";
OleDbCommand myCommand = new OleDbCommand ( query, myConn, myTrans );
  C# VB

See Also

OleDbCommand Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph