3
Answers

SQL Database not conecting to login form in asp.net

Kyle Oliver

Kyle Oliver

6y
647
1
Hi,
 
I am very new to programming and have created a login form in Microsoft Visual Studio using asp.net and C#.
 
In this form I have a "Login" button and the code behind login button is
 
SqlConnection con = new SqlConnection("Data Source=KYLELT\SQLEXPRESS;Initial Catalog=EmploymentEquity;Integrated Security=True");>
My connection string is "Data Source=KYLELT\SQLEXPRESS;Initial Catalog=EmploymentEquity;Integrated Security=True"
 
When I run the code i get a "Unrecognized escape sequence" on this line of code with a red underline below the "\" in the code.
 
I can't connect to my database with this connection string because of the "\", what am I doing wrong?
 
Regards,
Kyle
Answers (3)