i write the following code and adding data in the text box through combo box which is linked with access database but it is giving error .... the error is (Object is not an ADODB.RecordSet or an ADODB.Record.Parameter name: adodb)
... can you tell me what is the error in the following code:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Harpreet\\Documents\\access\\db2.mdb");
OleDbCommand cmdd = new OleDbCommand("Select * from Table1 where name ='" + comboBox1.SelectedValue + "'", con);
OleDbDataAdapter adpp = new OleDbDataAdapter(cmdd);
DataTable dtr = new DataTable();
adpp.Fill(dtr, "Table1");
if (dtr.Rows.Count > 0)
{
textBox1.Text = dtr.Rows[0]["Table1"].ToString();
}
}