我想在 Razor C# 中添加 2 个变量。
因此我尝试了这个:
var newpenpoints = result.PenaltyPoints + int.Parse(penalty);
但我认为当我尝试将图形放入数据库时它不起作用:
var sql5 = "UPDATE Permit SET PenaltyPoints=@0, Disqualification = @1, LastAccidentDate = @2 WHERE CDSID = @3";
var para1 = new{newpenpoints, disqualification, dateocc, empcdsid};
db.Execute(sql5,para1);
Response.Redirect("~/AccidentConviction");
出现错误:
CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
有谁知道我该如何修改我的代码以使其进行一些数学运算?
谢谢