Connection string Error: Unrecognized escape sequence

Last Reply 4 months ago By dharmendr

Posted 4 months ago

i am facing issue to connecting sql express server 2014 in using c# 

Error(Represent text as a sequence of UTF-16)

Unrecognized escape sequence


Posted 4 months ago

Hi akhter,

Use double sash.

SqlConnection con = new SqlConnection("Data Source=AT\\SQLExpress;Integrated Security=SSPI;Initial Catalog=SilverProduction;MultipleActiveResultSets=True;");

Or use @.

SqlConnection con = new SqlConnection(@"Data Source=AT\SQLExpress;Integrated Security=SSPI;Initial Catalog=SilverProduction;MultipleActiveResultSets=True;");