Thanks in advance,
Jeremyi answered my own question... hope this helps some one
To restate my problem.
I need an app that will list all of the available SQL Servers on a network. There are many ways to do this ... this is one. I would like to see better ways if anyone has time.
1. Download the SQLUtils.dll from (watch for line wrap)
http://codeproject.com/useritems/listsqlservers.asp?print=true
2. Register the SQLUtils.dll using regsvr32.exe
> regsvr32 c:/inetpub/wwwroot/lib/sqlutils.dll
3. Build your web form
// C#
using SQLUtils;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.ListBox ListBox1;
private void Button1_Click(object sender, System.EventArgs e)
{
SQLUtils.ListServers oSqlUtils = new SQLUtils.ListServers();
// String svr = new String();
oSqlUtils.Domain = TextBox1.Text;
oSqlUtils.GetSQLServers();
foreach( String svr in oSqlUtils.Servers )
{
ListBox1.Items.Add(svr);
} // end of foreach loop
} // end of Button1_Click()
4. You will need to add a reference in your project to the .dll file. Right click on the project and select "Add Reference". Browse to the location and select.
I also found these... (watch for line wrap)
http://www.windows2000faq.com/Articles/Index.cfm?ArticleID=14327
No comments:
Post a Comment