views:

55

answers:

2

Hi,

I moved a VS Solution file from an old PC to a new PC. When I opened the solution in VS2010, I found that the database connections in database explorer was not present. Now I want the project to connect to a SQL Server database which is local to the new PC. I have moved the database files (.ldf and .mdf) to the new location and created new connection in Database explorer. But the program seems to be not fetching any data when I run it. What are the other changes I need to do?

EDIT

I am using LINQ to SQL to query the database.

+1  A: 

From the server explorer you can get the connectionString of the new connection (the new server and the new db). Make sure you are using the right connectionString .

Svetlozar Angelov
Yeah the connection string is the same. Actually I am using LINQ to SQL just in case if it matters.
Manoj
+1  A: 

I assume you attached the database to your local SQL server and it's online. You might need to enable remote connections.

Run the SQL Server Surface Area configuration, it's in the Start menu. Under services and connections, choose the "Local and Remote connections" option. Restart the SQL service for this to take effect.

If that doesn't work, try the option with TCP/IP and named pipes.

Wez