private int DiscoverTcpPortViaSqlMonitor (string ServerName, string InstanceName) { SqlMonitorSocket msock; msock = new SqlMonitorSocket (ServerName, InstanceName); int SqlServerPort = msock.DiscoverTcpPort (ConnectionTimeout); msock = null; return SqlServerPort; }