OleDbConnection conn = new OleDbConnection(@"Provider=
Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|db.mdb;
Jet OLEDB:Database Password=csharp");
2.and then the following example shows rest -
using (DatabaseConnection)
{
conn.Open();
OleDbCommand cmd = new OleDbCommand("SELECT * from dbtable",
conn);
OleDbDataReader reader = cmd.ExecuteReader();
if (reader.HasRows == true)
{
reader.Read();
Label1.Text = reader.GetDateTime(0).ToShortDateString();
}
else
{
Label1.Text = "Unknown";
}}