4
Answers

error using where clause

sarbjeet singh

sarbjeet singh

13y
2.4k
1
guys its really urgent ,


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();


            }




Answers (4)