I have several SQL servers in my system:
2017 MSSQLSERVER
2008 SQLEXPRESS
In SSMS I see them like:
GM\
GM\SQLEXPRESS
If I need to connect to SQLEXPRESS I use connection string with .
in Server
:
connectionString="Server=.;Database=LearnCSharp;Integrated Security=True"
But what does .
means in my case and what should be placed in connection string in order to connect to 2017 MSSQLSERVER
?
UPD.:
.
connects to 2017 server. I have noticed that before computer restart it was connecting to 2008 server
GM
connects to 2017 server.
.\MSSQLSERVER
generates exception in my application;
System.Data.SqlClient.SqlException (0x80131904): 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: 25 - Connection string is not valid) ---> System.ComponentModel.Win32Exception (0x80004005): The parameter is incorrect
.\SQLEXPRESS and GM\SQLEXPRESS
- both connects to server 2008
`connectionString="Server=yourcomputername/sql2017express;Database=LearnCSharp;Integrated Security=True"` – MVC newbie Nov 14 '17 at 07:24