日期:2014-05-18 浏览次数:21196 次
SqlConnection conn; string sqlstr = "update KuCun set ShuLiang =ShuLiang-'" + TextBox2.Text.ToString().Trim() + "' where cast(BianHao as varchar(55))='" + TextBox1.Text.ToString().Trim() + "' and cast(ChiCun as varchar(55))='" + TextBox3.Text.ToString().Trim() + "'"; string connection = ConfigurationManager.ConnectionStrings["ErpConnectionString"].ConnectionString; conn = new SqlConnection(connection); SqlCommand cmd = new SqlCommand(sqlstr, conn); conn.Open(); cmd.ExecuteNonQuery();