ADO.NET Features and Future (SqlDataSourceEnumerator)

I have planned to dedicate some of my posts on ADO.NET and its future. I planned on the writing posts on new features of ADO.NET 2.0 and then slowly move to the LINQ and Entity Framework.

Lets start with the features one by one, today I am going to talk about the cool feature on the “Server Enumeration”. This helps us to find out the list of available servers from our local network accessible to us. The small piece of code the does the magic,

DataTable dt = new DataTable("NewTab");

//Gets the List of available SQL databases in DataTable

dt = SqlDataSourceEnumerator.Instance.GetDataSources();

This is really helpful when you create utility tool for quick data access.

Namoskar!!!