日期:2014-05-17  浏览次数:20408 次

新手问个SQL语句问题
我想要实现把某个textbox的值与数据库表的字段相加减,我写的语句出错了,各位大大帮忙看下,对于你们应该很简单。
update [Ship] set [Left_weight]-Int32.Parse(Label9.Text),[Now_weight]+Int32.Parse(Label9.Text);

------解决方案--------------------
string sql = string.Format("update Ship set Left_weight = Left_weight - {0}, Now_weight = [Now_weight] + {1}", int32.Parse(Label9.Text), int32.Parse(Label9.Text));