.NET Tip of The Day
Learn one new .NET trick every day
Быстрое пополнение счета телефона      Login or Join

Do not include the "@" character when supplying stored procedure parameter names to a SQL Server database

Avoid using database-specific tokens with stored procedure parameter names. ADO.NET classes for specific providers include code to adjust parameter names as required. This will ease migration existing ADO.NET programs to other DBMSs.

7/14/2007

Comments:

Huh? Can you give a code example please? Are you saying that the following could be written without the @ sign?

SqlParameter p_Id = new SqlParameter("@p_Id", SqlDbType.Int);

Paul 11/27/2007 3:17:13 AM

Exactly!

kostya.ly 11/27/2007 11:46:10 AM

Although this tip isn't that helpful, when you are explicitly creating a SqlParameter :)

Sami 12/12/2007 5:55:08 PM

As long as you use interface (IDbDataParameter) to work with instance of SqlParameter class the tip is helpful.

kostya.ly 12/14/2007 8:48:32 PM

Name
URL
E-mail
Provide your e-mail address to receive notification about new comments.
Message
HTML tags are not supported.
Please add 2 and 1 and type the answer here:
RSS .NET Tip of The Day
Subscribe to receive one tip from the .NET Tips and Tricks Community per day.
Previous Tips of The Day
The best of the .NET Tips & Tricks Community.
.NET Practitioners .NET Tips & Tricks Community
Every .NET practitioner has a trick up in their sleeve. This is the place to share it with other .NET people.
Submit a Tip
Discovered a new trick? Share it with others.
My Tips
Manage tips you authored.