Author: bigjim8987 | Posted on: 6/3/2008 3:03:16 PM | Views : 341

 As stated on this site the "@" is used for string literals.
http://dotnetslackers.com/CSharp/re-51752_The_Chash_String_Literal.aspx
 
My question is for when it is used in sql query strings infront of variables.

 
For instance as of how I connect to my database currently.
        myCommand2.CommandText = "INSERT INTO testimonials(name,email,testimonial,approved,time) VALUES (@name,@email,@testimonial,@approved,@time)";
        myCommand2.Parameters.AddWithValue("@name", txtName.Text);
        myCommand2.Parameters.AddWithValue("@email", txtEmail.Text);
        myCommand2.Parameters.AddWithValue("@testimonial", txtTestimonial.Text);
        myCommand2.Parameters.AddWithValue("@app ...

Go to the complete details ...