System.Data.OleDb Namespace OleDbDataAdapter Class
Initializes a new instance of the OleDbDataAdapter class with the specified SQL SELECT statement and an OleDbConnection object.
[ VB ]
Overloads Public Sub New ( _
ByVal selectCommandText As String, _
ByVal selectConnection As OleDbConnection _
)
[ C# ]
public OleDbDataAdapter (
string selectCommandText,
OleDbConnection selectConnection
);
[ C++ ]
public: OleDbDataAdapter (
String* selectCommandText,
OleDbConnection* selectConnection
);
[ JScript ]
public function OleDbDataAdapter (
selectCommandText : String,
selectConnection : OleDbConnection
);
- selectCommandText
- String specifying an SQL SELECT statement or stored procedure.
- selectConnection
- An OleDbConnection that represents the connection.
When an instance of OleDbDataAdapter is created, the following read/write properties are set to initial values.
You can change the value of any of these properties through a separate call to the property.
The following example initializes an OleDbDataAdapter using this constructor, then fills a DataSet.
// set up the connection
OleDbConnection myConn = new OleDbConnection (
"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" +
Server.MapPath ( "~/app_data/dbtutor.mdb" ) );
// set up the adapter
OleDbDataAdapter myAdapter = new OleDbDataAdapter ( "SELECT * FROM Products", myConn );
// instantiate dataset object
DataSet myData = new DataSet ( );
// fill with query results
myAdapter.Fill ( myData, "products" );
' set up the connection
dim myConn as new OleDbConnection ( _
"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" +
Server.MapPath ( "~/app_data/dbtutor.mdb" ) )
' set up the adapter
dim myAdapter as new OleDbDataAdapter ( "SELECT * FROM Products", myConn )
' instantiate dataset object
dim myData as new DataSet ( )
' fill with query results
myAdapter.Fill ( myData, "products" ) |
|
C# |
VB |
OleDbDataAdapter Members OleDbDataAdapter Constructor Overload List MissingMappingAction MissingSchemaAction