I am trying to set a SQL parameter to a decimal, but when I run my code I get an error
must declare the scalar variable @Per_Cent..
The code is below, thanks in advance
SqlParameter PerCent = new SqlParameter("@PerCent", SqlDbType.Decimal, 5);
PerCent.Value = PerCentV;
Your error refers to variable named “@Per_Cent” but you’re adding a parameter called “@PerCent”….
Also, I’m assuming you are then adding that SqlParameter to the SqlCommand