MS SQL SERVER 2008R2 CONNECTION WITH VISUAL STUDIO 2012

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
C# 
C#
 1125  View(s)
Ratings:
Rate this:

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....

  1. ezra heywood

    Post:145

    Points:1019
    Re: MS SQL SERVER 2008r2 connection with Visual studio 2012

    Hi Ankit,

    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");

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!