Kyle Oliver

Kyle Oliver

  • 2k
  • 67
  • 19.1k

SQL Database not conecting to login form in asp.net

Feb 19 2019 11:02 AM
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)