How to get the list of SqlInstances of a paricular machine
- by Cute
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;
?