Why does SqlParametersCollection require "@" at the beginning of the parameter name every time?
Well, the title of the question is pretty much the question itself, so why would I have to write "@" every time before the sql parameter name like this?
command.Parameters.AddWithValue("@CustomerID", this.CustomerId);
I know this is how parameters are declared with SQL, but shouldn't that be handled by the framework as it always does?
+3
source to share
2 answers
Variable names in MS SQL Server must start with the at sign (@). See How To Declare Variables in SQL for more information.
+1
source to share