How to list available instances of SQL Servers using SMO in C#?
Posted
by Cute
on Stack Overflow
See other posts from Stack Overflow
or by Cute
Published on 2009-07-15T10:23:41Z
Indexed on
2010/05/01
16:57 UTC
Read the original article
Hit count: 168
Hi
Can anybody explain me what I wrong I am doing in the following piece of code:
DataTable dt=SmoApplication.EnumAvailableSqlServer(true);
Server sr = new Server("Test");
foreach(DataBase db in sr.DataBases)
{
Console.WriteLine(db["name"]);
}
It gives an exception in sr.Databases
that can not be connected.
© Stack Overflow or respective owner