quotation marks in string - how to add

  • Thread starter Thread starter Ufit
  • Start date Start date
U

Ufit

Simple,dumm question - how to include quotation marks in the string?
F.ex. "Data Source=.\SQLEXPRESS;AttachDbFilename="C:\client data.mdf";Integrated Security=True;User Instance=True"
I get syntax error.
Thanks for help

Ufi
 
You put them in twice. So something like:

Dim s as String = "Double quotes around test: ""test"""
 
Ufit said:
Simple,dumm question - how to include quotation marks in the string?
F.ex. "Data Source=.\SQLEXPRESS;AttachDbFilename="C:\client
data.mdf";Integrated Security=True;User Instance=True"
I get syntax error.

Encode each quotation mark that should appear in the string as two
consecutive quotation marks:

\\\
s = "He said ""Hello World!"""
///
 
Back
Top