Title

Kodyaz Development Resources

Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.
Welcome to Kodyaz Development Resources Sign in | Join | Help

List SQL Server Instances using .Net Framework SqlDataSourceEnumerator class

File Details
Downloads: 2154 File Size: 64.6kB
Posted By: eralper Views: 1463
Date Added: 28 Sep 2007
You can list both SQL Server 2000 and SQL Server 2005 database instances within a network using this sample application code. The sample application uses the SqlDataSourceEnumerator class which is introduced with .Net Framework 2.0 to enumerate existing SQL Server instances. The sample Windows Forms application uses the Sql.SqlDataSourceEnumerator.Instance.GetDataSources() method to get a DataTable object instance populated with Microsoft SQL Server instances installed within the current network area. And as seen in the sample, you can populate and fill a DataGridView object or populate a ComboBox object with retrieved values about SQL Server instances.
Comments
 

CarlosMAg said:

Greatest, Simple and Usefull... Thanks...!!!!
25 Oct 2007 2:53 PM
 

Peter said:

I have created something similar to yours except I used DbProviderFactory. I run yours and mine on a Windows XP Professional 64bit machine which has 2 instances: mymachine\SQLExpress (Express Edition) and MSSQLSERVER (Developer Edition (64bit)) SQL Browser Service: not running SQLInstance and my own coding: returned MSSQLSERVER SQL Browser Service: running SQLInstance and my own coding: returned mymachine\SQLEXPRESS Do you have any idea why it won't return both instances? Thanks, Peter
18 Dec 2007 5:11 PM
 

zawmn said:

file corrupt. can't open archive
13 Jun 2008 7:04 AM
Copyright © 2004 - 2008 Eralper Yilmaz. All rights reserved.
Powered by Community Server, by Telligent Systems