SQL server 2008 db on one physical server was migrated to other physical server with SQL express 2008. All tables and data were successfully migrated, but I am not able to connect with my asp.net mvc app to the new express db.
In my connection string, I have just changed the IP add. of the physical server:
<add connectionString="server=XX.XX.XX.XXX;database=hgw;user id=hgw;password=hgw4p1!;Trusted_Connection=false" name="HGWDBContext" providerName="System.Data.SqlClient" />
what generates following error:
Server Error in '/HGW' Application. The system cannot find the file specified. 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
I have seen somewhere that the migration of db does not migrate users and passwords. But even when I change user id and pass to actual admin's it generates the same error. (btw in Server Properties - Connections - remote connection is allowed)
It is just something I am missing in the connection string or do I have to create new user id or it is something else? thx
SQL Server Express is installed using a named instance. So your connection string should be changed to
server=YourServerName
You could try it using the search feature of Sql Server Management Studio and use the same string used by the application to connect to Sql Server Express