Thursday, August 22, 2013

Compiler Error Message: CS1009: Unrecognized escape sequence

Compiler Error Message: CS1009: Unrecognized escape sequence
Source Error:
 
Line 16:  { 
Line 17: 
Line 18:    SqlConnection dbConnection = new SqlConnection("server=(Server\Instance); 
Line 19:                                 uid=;pwd=;database=DBname;"); 
Line 20: 


Solution:

SqlConnection dbConnection = new SqlConnection("server=server\\Instance;uid=sa;pwd=;database=DBname;");
Or
SqlConnection dbConnection = new SqlConnection("Server=(local);Integrated Security=true;Initial Catalog=DBname;");

No comments:

Post a Comment