Juha

Juha

  • NA
  • 4
  • 0

Find server and server instance names

Oct 14 2011 4:20 AM
I have two databases, one on my local work computer and other on a server. Both have been created with Microsoft SQL Server 2008. I can access both of them with connection strings that contains names of the servers and some other information. However the names contain only the ip-number of the server. And I need the full name of the server and the instance created, separated with "\" character. I can see them in my SQL management studio but I need to get them from VB-code.

I created SqlConnection-class but it finds only the ip-addressed name. SqlSourceDataEnumerator won't do good because it finds all unnecessary server names that I don't need. How can I find the real name of the server that is specified in the connection string?