You need to use the variant with the '@'. The '@' symbol signifies a variable or a stored procedure / function parameter.
Adding SQL Parameters in C#
-
11-12-2021 - |
質問
What is the difference between:
myCommand.Parameters.AddWithValue("search", "% " + myValue + " %");
and:
myCommand.Parameters.AddWithValue("@search", "% " + myValue + " %");
The difference above is with and without the @ symbol. Does it do anything special?
解決
他のヒント
in sql stored procs or functions you must specify parameters name by '@' sign at the beginning of their name
所属していません StackOverflow