2

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?

2 Answers 2

4

You need to use the variant with the '@'. The '@' symbol signifies a variable or a stored procedure / function parameter.

Sign up to request clarification or add additional context in comments.

Comments

0

in sql stored procs or functions you must specify parameters name by '@' sign at the beginning of their name

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.