更新时间:2023-02-20 12:01:35
您应使用SqldataReader
You should use SqldataReader
SqlCommand cmd = new SqlCommand("select * from Table1",conObject);
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
if (TextBox1.Text == dr.GetString(0)) // 0 is 1st column
{
//Do as your wish
}}
我忘了引用引号了:
I forget to mention quotes:
Da = new SqlDataAdapter("select * from tblorder where bookingdate=''" + txtform.text + "''",con1);