sql语句用到变量比较大小

来源:百度知道 编辑:UC知道 时间:2024/06/09 11:00:04
sql server中
sql = Update tbCusInfo Set light='红' Where Con >= (con)
这里的con是c#中我定义的一个变量,double con;
con的值是从form的textbox获得的。
请问我该怎么写这个sql,谢谢

如果你的变量值绑定在textbox的value:Update tbCusInfo Set light='红' Where Con >='"+textbox.value.tostring()+"'
如果你的textbox的value和text值一样,也可以 Update tbCusInfo Set light='红' Where Con >= '"+textbox.text.tostring()"'+

double con=Convert.ToDouble(this.textBox.Text);
Update tbCusInfo Set light='红' Where Con >= con