Dear Catalin,
My SQL Server version is 2014, but I think this will happen in all versions. I am using the default instance but it also happens if it is not the default.
My OS is Windows 10 Home.
In summary, the issue is as following: when setting [SERVER_PROP],[PORT_PROP] in the database configuration page, system assumes I want to connect to SQL Server using TCP/IP protocol.
There are some points to note here:
- For local SQL Server instance, by default TCP/IP protocol is disabled. That is the importance of (local) name. When connection string uses it in the data source parameter, connection is made to the default instance using shared memory
- For remote SQL Server instances, TCP/IP connection is fine, so only in that case, the [SERVER_PROP],[PORT_PROP] setting works. That is important if the port is not the default.
- If setting is [SERVER_PROP], as I had before, it works for all cases, local and remote, only if the default port. If that is the case, when using (local) as the datasource, connection is made using shared memory. If the datasource is an IP, localhost or a machine name, connection is made using TCP/IP. Of course, TCP/IP should be enabled in the target machine.
- If the SQL Server Dialog uses Server Browse to get the list of servers discovered in the network, it returns (local) as the name of the local machine, instead of localhost or the machine name.
I think one solution could be to set the property dynamically. Is that possible?
As you see in my SQL Server dialog, I have 2 fields, one for the db instance and one for the port.
What if I define the Server property in the SQL Databases page as just [SERVER_PROP] and in my dialog change that value to be [SERVER_PROP],[PORT_PROP] only when the server is different from
(local)? is that possible?
Other question. Is it possible to do some action when the combobox change its value? for example, if the combobox value is
(local), the port field should be disabled since when
(local), port number is useless.
Kind regards
Jaime