SqlConnection con = new SqlConnection("server =(local);database = denglu;uid = sa;pwd = 123456");
con.Open();
SqlCommand cm = new SqlCommand("select count(*) from [check] where 用户名= '" + TextBox1.Text + "'", con);
int count = Convert.ToInt32(cm.ExecuteNonQuery());
Label3.Text = Convert.ToString(count);
执行完这行代码后为什么label3显示的一直是-1,并且无论输入值在表中是否存在
con.Open();
SqlCommand cm = new SqlCommand("select count(*) from [check] where 用户名= '" + TextBox1.Text + "'", con);
int count = Convert.ToInt32(cm.ExecuteNonQuery());
Label3.Text = Convert.ToString(count);
执行完这行代码后为什么label3显示的一直是-1,并且无论输入值在表中是否存在
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货