private void button1_Click(object sender, EventArgs e)
{
OleDbConnection connection = new OleDbConnection();
connection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Fahad\Database\Database1.mdb;User Id=admin;";
command = new OleDbCommand("SELECT * FROM details", connection);
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
DataTable dt = new DataTable();
connection.Open();
adapter.Fill(dt);
DataSet dsSet = new DataSet();
//use the databinding to show the data in textbox
textBox2.DataBindings.Add(
"Text", dt, "Address", true);
dateTimePicker1.DataBindings.Add(
"Text", dt, "DOB", true);
bool bClmnVal = (bool)dsSet.Tables[0].Rows[0]["____"];//err.....cannot find table 0
if (bClmnVal)
{
M.Checked =
true;
F.Checked =
false;
}
else
{
M.Checked =
false;
F.Checked =
true;
}
connection.Close();
}
still not workin!