The message
Represents text as a series of Unicode characters
is not an error, it is the description of string
.
The code actually has an error that is to use \
as literal, this character needs to be escaped.
There are two options for this:
Use \
to escape this character only.
Ex: "Teste\Teste
"equals Teste\Teste
.
new SqlConnection("Data Source=(localdb)\MSSQLLocalDB;OutrosParametros");
Use @
at the beginning of string
. This will do what the text is represented that way. In other words, string
turns a string literal (or verbatim string ).
Ex: @"Teste\nTeste"
is equal to Teste\nTeste
.
new SqlConnection(@"Data Source=(localdb)\MSSQLLocalDB;OutrosParametros");