EnumAvailableSqlServers and sqlexpress

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
 
W

Willy Denoyette [MVP]

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.
 
T

Torben Laursen

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
 
W

Willy Denoyette [MVP]

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.
 
T

Torben Laursen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top