I am trying to develop an application that runs sql scripts either or on a local or on a remote sql server to update values on the application. The connection status is checked using:
TcpClient client = new TcpClient(serverName, 1433);
Once we know that we can listen using the port, I will have to pass the login credentials to the SQL server either using Windows/SQL server authentication. But the problem is that the application needs to determine if the server it is connecting to is local or remote based on which the functionality of the application can vary.
e.g: Use integrated security if using local windows authentication.
Can anyone please assist me in as to how I would be able to determine if the connection is remote or local as based on this my application can be developed to enable different functionality/properties.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)