Hi
I am N.Ramasamy. I am working as a programmer. To connect oledb with MS Access, we want to write the query string as follows
string qs = @"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=e:\db\names.mdb";
one important thing is we want to give space in between DAtA and Source
I have created one database named as names.mdb and it has name as a table.
The name table has the following fields
1.ID
2. Name
the database placed within e:\db
coding
string qs = @"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=e:\db\names.mdb";
OleDbConnection con = new OleDbConnection(qs);
con.Open();
OleDbCommand com = new OleDbCommand( "select * from name", con);
OleDbDataReader reader =com.ExecuteReader();
while (reader.Read())
{
Response.Write("<br>" + reader["ID"]);
Response.Write("<br>" + reader["Name"]);
}
|