asp.net.ph

OleDbDataAdapter Constructor

System.Data.OleDb Namespace   OleDbDataAdapter Class


Initializes a new instance of the OleDbDataAdapter class.

Overload List

1. Initializes a new instance of the OleDbDataAdapter class.

2. Initializes a new instance of the OleDbDataAdapter class with the specified OleDbCommand object.

3. Initializes a new instance of the OleDbDataAdapter class with the specified SQL SELECT statement and a connection string.

4. Initializes a new instance of the OleDbDataAdapter class with the specified SQL SELECT statement and an OleDbConnection object.


Example

The following example initializes an OleDbDataAdapter, then fills a DataSet.

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

// set up the connection
string connString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + 
   Server.MapPath ( "~/app_data/dbtutor.mdb" );
// set up the query
string query = "SELECT * FROM Products";

// set up the adapter
OleDbDataAdapter myAdapter = new OleDbDataAdapter ( query, connString );

// instantiate dataset object
DataSet myData = new DataSet ( );
// fill with query results
myAdapter.Fill ( myData, "products" );
  C# VB

See Also

OleDbDataAdapter Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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