hey i am trying to connect database table with my form in C#
Here is my code....
private void btn_quiz_Click(object sender, EventArgs e)
{
String constr = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\\Documents and Settings\\Zohaib\\My Documents\\Visual Studio 2010\\Projects\\CheckAbility\\Qusetions.accdb";
OleDbConnection conn = new OleDbConnection(constr);
conn.Open();
OleDbCommand command = new OleDbCommand("SELECT * FROM Table1", conn);
OleDbDataReader recordset = command.ExecuteReader();
label3.Text = recordset[0].ToString();
}
there is only one record in my table
but its giving me error
no data exist for the row column
Also tell me how to select one record from the table on the basis of id????
Plz rply soon
Thanx in Advance