kevinjd
asked on
How to include quotation marks in a string
(This is a C# client/server app)
I have the following string variable
sTripUpdateSql = "Update trip set " + dc.ColumnName + " = " + sqlValue + " where TrpId = " + dr["TrpId"];
I need the sqlValue variable to include quotation marks around it. For example, if sqlValue holds the value test, i want it to display "test" when the entire string is displayed.
So how do I hard code a set of quotes inside the string?
thanks
I have the following string variable
sTripUpdateSql = "Update trip set " + dc.ColumnName + " = " + sqlValue + " where TrpId = " + dr["TrpId"];
I need the sqlValue variable to include quotation marks around it. For example, if sqlValue holds the value test, i want it to display "test" when the entire string is displayed.
So how do I hard code a set of quotes inside the string?
thanks
the \" puts a quote in there
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
s.Text= "\"nathan\"";
Label2.Text = s.Text;
this will output the text
"nathan"