//first add reference of Microsoft SQLDMO Object Library
SQLDMO.Application app = new SQLDMO.ApplicationClass();
SQLDMO.NameList names = app.ListAvailableSQLServers();
string serverName = "";
for (int i = 1; i <= names.Count; ++i)
{
serverName = names.Item(1);
MessageBox.Show(serverName);
}
No comments:
Post a Comment