0

I am developing an application that contains a small SQL Server database File.

On my machine, it works fine. I am using Microsoft Visual C# Express 2010.

I have sent my project to a colleague. He is using the same software. And he has placed the database file in the same place (c:\folder\db.mdf). However, he gets the following error when trying to open the connection:

System.Data.SqlClient.SqlException was unhandled
Message=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. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

How can I help my colleague get connected? He is on the other side of the country.

3
  • Does your colleague have SQL Server Express (same version or newer) installed? What does your connection string look like (to make the connection to the database)?? Commented Jul 16, 2011 at 10:40
  • The error messages says that the SQL server could not be found (on his machine). You may need to edit the connection string. Commented Jul 16, 2011 at 11:04
  • The connection string is: @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\betfairData\db.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"; I do not know whether or not the user has Visual SQL Express installed, but he assures me that the datbase file is in the correct place. Commented Jul 16, 2011 at 11:36

1 Answer 1

0

There are several ways to copy a database from one machine to another - the way I normally do it is to use SQL Server management studio to do a backup on the "from" and then to do a restore on the "to".

For more information, check out questions/answers like:

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.