String and Quotes in them
Posted on 2006-11-19
I have the following SELECT Statement.
dbcommand.CommandText = "SELECT * FROM tblUsers WHERE Username=" + uname;
However, in order for it to work properly I have to put quotes around the reseult of the pased uname variable. How do I do this in C#.
So if uname was passed as Mike, the SELECT statment would need to be SELECT * FROM tblUsers WHERE Username="Mike"
I can not get the quotes around the name.