Getting list of database servers into combo box

  • Thread starter Thread starter doofy
  • Start date Start date
D

doofy

Anyone know how I can pull in a list of available database servers on my
computer (which I will then use to populate a combo box)?

Even just the namespace to use would be a start, though more info than
that would be a lot more helpful.

Filling the combo box is something I think I can figure out. Just need
to know how to search for the servers.

The better option is how I could access these common forms used to
connect to databases, where all the layers are asked for in the form,
and at the end you hit a "Test Connection" button. Are those available
via code?
 
doofy said:
Anyone know how I can pull in a list of available database servers on my
computer (which I will then use to populate a combo box)?

Even just the namespace to use would be a start, though more info than
that would be a lot more helpful.

Filling the combo box is something I think I can figure out. Just need
to know how to search for the servers.

The better option is how I could access these common forms used to
connect to databases, where all the layers are asked for in the form,
and at the end you hit a "Test Connection" button. Are those available
via code?

Thanks for those links. At least now I have an acronym to work with,
and some code.
 
doofy said:
Anyone know how I can pull in a list of available database servers on my
computer (which I will then use to populate a combo box)?

Even just the namespace to use would be a start, though more info than
that would be a lot more helpful.

Filling the combo box is something I think I can figure out. Just need
to know how to search for the servers.

The better option is how I could access these common forms used to
connect to databases, where all the layers are asked for in the form,
and at the end you hit a "Test Connection" button. Are those available
via code?

By the way, that was sincere thanks. I was thinking that "at least now
I have an acronym to work with" sounded sarcastic.
 
I hear ya dude.

"Tone" is not relayed in emails very well.

It why its a terrible tool for things like conflict resolution or anything
outside of just presenting factual information.

...

But I appreciate the clarification.
 
If you don't have access to the SQL DMO objects (or the SQL Management
objects which come with newer versions of SQL server), then you can call the
NetServerEnum API through the P/Invoke layer, looking for the
SV_TYPE_SQLSERVER type.
 

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

Back
Top