I have a server that has SQL Server 2008 R2 installed but my application uses SQL Express 2008 R2 – do I need to install SQL Express as well? The error Im currently getting is:
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)
You can create your database the SQL Server and connect with the correct connection string. You can not attach your Database files like in SQL Server express though.
There is no need to install SQL Server Express.
A common connection string to connect to SQL Server is:
Replace
yourServerwith the servername (in the form of Server\instance) andyourDatabasewith the name of the database you wish to connect to.The following connection string for SQL Server Express does not work on a standard SQL Server: