0

I am using connection string like this:

SqlConnection con = new SqlConnection("Data Source=DESKTOP-8L8G5P8\SQLEXPRESS;Initial Catalog=sai;User ID=sa); 

But it raises the error at the server name.

1 Answer 1

1

I think you have messed up somethings .Try this.It may work

SqlConnection con = new SqlConnection("Data Source=DESKTOP-8L8G5P8\\SQLEXPRESS;Initial Catalog=sai;User ID=sa;");

you have messed double slash(\\) and double quote(" ")

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.