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




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