Link to home
Create AccountLog in
Avatar of kevinjd
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
Avatar of burakiewicz
burakiewicz
Flag of United States of America image

Literal s = new Literal();
s.Text= "\"nathan\"";
Label2.Text = s.Text;

this will output the text
"nathan"
the \"  puts a quote in there
ASKER CERTIFIED SOLUTION
Avatar of rendaduiyan
rendaduiyan
Flag of China image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer