i have a table with two fields s_no and level
both are integers
and i m searching s_no by passing value for level
but getting the error of datatype mismatch
int sno = Convert.ToInt32(TextBox1.Text);
con.Open();
OleDbCommand cmd = new OleDbCommand("select level1 from memreg where s_no ='"+ sno + "'" , con);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Label1.Text = dr[0].ToString();
}

sarbjeet singh69 reputationPosted Apr 17, 2011, 10:45 PM EDT
OleDbCommand cmd = new OleDbCommand("select level1 from memreg where s_no =" + sno , con);
Suthish NairRank #92 · 22.8K reputationPosted Apr 18, 2011, 11:09 AM EDT
sarbjeet singh69 reputationPosted Apr 18, 2011, 9:21 PM EDT
Ankit NandekarRank #703 · 3.4K reputationPosted Apr 18, 2011, 9:38 PM EDT