1) I'm looking for a way within a VB.Net/ADO.Net program to determine if and what port an named instance of Microsoft SQL is using without resorting to a registry key (too many different places to look), hacked event log (unreliable), or opening SQL Configuration Manager (again, I need to do this is a program).
2) If I determine that SQL is not configured to use TCP then is there a reliable way through VB.Net/ADO.Net to enable TCP/IP and set a port?
In both cases these functions would be running with elevated privileges during a setup.