EnumAvailableSqlServers and sqlexpress

  • Thread starter Thread starter Torben Laursen
  • Start date Start date
T

Torben Laursen

Hi

I am trying to find find the sqlserver express that is running on my
computer using:
DataTable dtSQLServers = SmoApplication.EnumAvailableSqlServers(false);

It returns one row that holds the name "Office1" but the sqlserver is:
"Office1\SQLExpress"

If I try to connect to "Office1" I get a very long errormessage while if I
connect to "Office1\SQLExpress" it works fine.

How do I get EnumAvailableSqlServers to return the "correct" name?



Thanks Torben
 
Torben Laursen said:
Hi

I am trying to find find the sqlserver express that is running on my computer using:
DataTable dtSQLServers = SmoApplication.EnumAvailableSqlServers(false);

It returns one row that holds the name "Office1" but the sqlserver is:
"Office1\SQLExpress"

If I try to connect to "Office1" I get a very long errormessage while if I connect to
"Office1\SQLExpress" it works fine.

How do I get EnumAvailableSqlServers to return the "correct" name?



Thanks Torben


What column are you looking at?

Willy.
 
I am looking at Name and server.
I have a second office computer on the network that also runs sqlexpress and
the code returns the correct name for that one.

First row: (network computer)
Server: Office3
Name: Office3\\SQLexpress

Second row (computer where the code runs)
Server: Office1
Name: Office1

Torben
 
Torben Laursen said:
I am looking at Name and server.
I have a second office computer on the network that also runs sqlexpress and the code
returns the correct name for that one.

First row: (network computer)
Server: Office3
Name: Office3\\SQLexpress

Second row (computer where the code runs)
Server: Office1
Name: Office1

Does this mean that the instance column is empty?

Willy.
 
Yes, the information is:
First row: (network computer)
Server: Office3
Instance: Sqlexpress

Name: Office3\\SQLexpress
Second row (computer where the code runs)
Server: Office1
Name: Office1
Instance: {}

Torben
 
Back
Top