C# 解析查询令牌行号 1 时出错
cmmd.CommandText = "Select total from Dept_Sales where department ='" + department + "'";
var dtotal = cmmd.ExecuteScalar().ToString();
var nntotal = dtotal + price;
SqlCeCommand cmmmmd = new SqlCeCommand("update [Dept_Sales] SET [total]=@val1) where [department]=@val2", conn);
{
cmmmmd.Parameters.AddWithValue("@val1", nntotal);
cmmmmd.Parameters.AddWithValue("@val2", department);
cmmmmd.CommandType = System.Data.CommandType.Text;
cmmmmd.ExecuteNonQuery() }
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
also dtotal =3.51
and price = 3.51
nntotal = 7.02
我认为我的查询可能有问题我已经更改了 15 次相同的错误任何人都可以给我任何建议