int y = Convert.ToInt32(TextBox1.Text);
string select_count = "select count(*) from ZHtjqrx where year='+y+'";这两端话的目的是判断表ZH中year这一列中是否含有y这个字段。
红色字体里具体怎么写呢?
string select_count = "select count(*) from ZHtjqrx where year='+y+'";这两端话的目的是判断表ZH中year这一列中是否含有y这个字段。
红色字体里具体怎么写呢?
或者 string select_count = "select count(*) from ZHtjqrx where year="+y;
不過建議用SQLParameter來傳值,以防注入攻擊