How to get the list of SqlInstances of a paricular machine

Posted by Cute on Stack Overflow See other posts from Stack Overflow or by Cute
Published on 2009-07-08T09:14:12Z Indexed on 2010/03/18 5:01 UTC
Read the original article Hit count: 432

Filed under:
|
|
|
|

Can anyone tell me how to get remote Sqlserver instances using c# and SMO or any api?

I have a remote server name "RemoteMC", which has 2 instances of sql server: "RemoteMc" and "RemoteMC\sqlexpress"

I try to get the instances in code like this:

Server srv=new Server("RemoteMC");
DataTable dt=SmoApplication.EnumAvailableSqlServer(true);

But it returns "Host\sqlexpress"

I don't know what went wrong. How can I get the result back as:

RemoteMC
RemoteMC\sqlexpress;

?

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql-server