I would like to add 2 variables in Razor C#.
Therefore I tried this:
var newpenpoints = result.PenaltyPoints + int.Parse(penalty);
But I think it is not working as when I try to put the figure into database:
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");
There was en error:
CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
Does anyone know how can I amend my code to make it do some maths?
Thanks