0
votes

I have created an application that connects to a SqlDataBase that I created in c# visual studio 2015 using Add->New Item->Service-based Database. I've pushed the app to Github but when my friend tried to run the program he got this exception :

A network-related or instance-specific error occurred while establishing a connection to SQL Server.
The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections

My connection string is : Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\RegisterDataBase.mdf;Integrated Security=True

1
Can you confirm with your friend that he has the Database in his updated code?Narayanan S

1 Answers

0
votes

Your connection points to your SQL Server Express LocalDB instance.

LocalDB doesn't allow remote connections, please refer to documentation for more details about usage and limitations.

The issue has been already addressed here and here.