Reputation: 13
SqlConnection con = new SqlConnection("Data source=BIMESH-PC\SQLEXPRESS;initial catalog=LibrSystem;integrated security=true");
In this code the escape sequence is not acceptable. please rectify this code.
Upvotes: 1
Views: 1043
Reputation: 166316
You could try either
SqlConnection con = new SqlConnection(@"Data source=BIMESH-PC\SQLEXPRESS;initial catalog=LibrSystem;integrated security=true");
SqlConnection con = new SqlConnection("Data source=BIMESH-PC\\SQLEXPRESS;initial catalog=LibrSystem;integrated security=true");
You should have a look at verbatim string literals, and escaped string literals
Upvotes: 1