|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL DMO Lists files severs tooall kinds of servers not just SQL Server. It lists file servers and some more items that I am not even aware of. Please help! This is my code for listing servers: private SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass(); SQLDMO.NameList sqlServers = null; try { //get all available SQL Servers sqlServers = sqlApp.ListAvailableSQLServers(); for (int i = 0; i < sqlServers.Count; i++) { object srv = sqlServers.Item(i + 1); if (srv != null) { this.comboBox1.Items.Add(srv); } } if (this.comboBox1.Items.Count > 0) this.comboBox1.SelectedIndex = 0; else this.comboBox1.Text = "<No available SQL Servers>"; } catch (Exception err) { MessageBox.Show(err.Message, "Error"); } I appreciate any help |
|||||||||||||||||||||||