Stupid question, but I have never been able to find an answer to this. When I first started doing Asp.Net in C# or VB, all the examples to add SQL command parameters look like:
cmd.Parameters.AddWithValue("@Id", rowId);
When going back through my code, I sometimes find I did this: cmd.Parameters.AddWithValue("Id", rowId);
It works just fine. Also, after using Dapper a little lately, a lot of the examples don't add the ampersand, either.
What exactly does the ampersand do with SQL parameters? Is it a .net thing or does it do something in the sql server.
This is yet another one of those things that is hard to search for, because it pulls up all kinds of things except what I'm wondering here.
Thanks,
cmd.Parameters.AddWithValue("@Id", rowId);
When going back through my code, I sometimes find I did this: cmd.Parameters.AddWithValue("Id", rowId);
It works just fine. Also, after using Dapper a little lately, a lot of the examples don't add the ampersand, either.
What exactly does the ampersand do with SQL parameters? Is it a .net thing or does it do something in the sql server.
This is yet another one of those things that is hard to search for, because it pulls up all kinds of things except what I'm wondering here.
Thanks,