How can I determine is it local connection (localhost or 127.0.0.1) or is it remote connection (other machine in local area) if I have SqlConnection object?
Ask SQL using the connection with the statement
SELECT @@SERVERNAME
then verifiy if this match the name of the client machine with Environment.MachineName, modulo the SQL instance name