MS SQL SERVER 2008r2 connection with Visual studio 2012

Total Post:341

Points:2389

C# 
C#
 1597  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. 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

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.