private void comboBox2_SelectedValueChanged(object sender, EventArgs e) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Harpreet\\Documents\\db4.mdb"); con.Open(); string sql = "select floor from Table1 where RoomNo = '" + comboBox2.Text + "'"; OleDbDataAdapter da = new OleDbDataAdapter(sql, con); comboBox2.SelectedIndex = 0; DataSet ds = new DataSet(); da.Fill(ds, "Table1"); DataRow drow = ds.Tables["Table1"].Rows[0]; textBox1.Text = drow.ItemArray.GetValue(0).ToString(); con.Close(); } plz suggest what is the reason behind that error... i will be very thankful to you....
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Harpreet\\Documents\\db4.mdb"); con.Open(); string sql = "select floor from Table1 where RoomNo = '" + comboBox2.Text + "'"; OleDbDataAdapter da = new OleDbDataAdapter(sql, con); comboBox2.SelectedIndex = 0; DataSet ds = new DataSet(); da.Fill(ds, "Table1"); DataRow drow = ds.Tables["Table1"].Rows[0]; textBox1.Text = drow.ItemArray.GetValue(0).ToString(); con.Close(); } plz suggest what is the reason behind that error... i will be very thankful to you....
con.Open();
string sql = "select floor from Table1 where RoomNo = '" + comboBox2.Text + "'"; OleDbDataAdapter da = new OleDbDataAdapter(sql, con); comboBox2.SelectedIndex = 0; DataSet ds = new DataSet(); da.Fill(ds, "Table1"); DataRow drow = ds.Tables["Table1"].Rows[0]; textBox1.Text = drow.ItemArray.GetValue(0).ToString(); con.Close(); } plz suggest what is the reason behind that error... i will be very thankful to you....
OleDbDataAdapter da = new OleDbDataAdapter(sql, con); comboBox2.SelectedIndex = 0; DataSet ds = new DataSet(); da.Fill(ds, "Table1"); DataRow drow = ds.Tables["Table1"].Rows[0]; textBox1.Text = drow.ItemArray.GetValue(0).ToString(); con.Close(); } plz suggest what is the reason behind that error... i will be very thankful to you....
comboBox2.SelectedIndex = 0;
DataSet ds = new DataSet(); da.Fill(ds, "Table1"); DataRow drow = ds.Tables["Table1"].Rows[0]; textBox1.Text = drow.ItemArray.GetValue(0).ToString(); con.Close(); } plz suggest what is the reason behind that error... i will be very thankful to you....
da.Fill(ds, "Table1"); DataRow drow = ds.Tables["Table1"].Rows[0]; textBox1.Text = drow.ItemArray.GetValue(0).ToString(); con.Close(); } plz suggest what is the reason behind that error... i will be very thankful to you....
DataRow drow = ds.Tables["Table1"].Rows[0]; textBox1.Text = drow.ItemArray.GetValue(0).ToString(); con.Close(); } plz suggest what is the reason behind that error... i will be very thankful to you....
textBox1.Text = drow.ItemArray.GetValue(0).ToString();
con.Close();
} plz suggest what is the reason behind that error... i will be very thankful to you....
string sql = "select floor from Table1 where RoomNo = '" + comboBox2.Text.ToString() + "'";