This Blog Has Been Moved !

This Blog Has been moved to http://aleemkhan.wordpress.com

Just getting ready to board for Lahore, the boarding will start on 11:45. Never thought will be using Internet from the Airport, was just getting bored sitting near the Duty Free here at the Airport and turned on my laptop and it connected to the Airport Wireless Broadband, so good way to pass time. I should get going, boarding time is getting close.

Today I am flying back to Pakistan; it’s been 3 months in Dubai and my record for living away from home this long. It’s a short trip probably 5-6 days but I think it’ll be relaxing. I can’t wait to reach. Life in Dubai has been good but living with family has its own charm which u cannot get anywhere. Ok I should start packing, have to leave for Airport in a couple of hours.

Bye !

I was just working on a small application in Visual Studio 2005, I am using the SqlDataSourceEnumerator which is new in Framework 2.0 and enumerates all the instances of SQL Server 2000 and SQL Server 2005 on the network, following is my function from my class.

The interesting thing is that SqlDataSourceEnumerator does enumerates all servers including the SQL Server on my local machine when I am connected to the network, but if I am not connected to a network, it does not even get my local SQL Server. This is quite strange, because even if the API it works for the network it should check the loopback (127.0.0.1) network.

I know I can solve this by using the SQLDEMO API’s to get the SQL Servers as we have been doing in 1.1, but still am looking for the answer for the behavior of SqlDataSourceEnumerator

public string[] GetAllServerNames()

{

ArrayList array = new ArrayList();

SqlDataSourceEnumerator dse = SqlDataSourceEnumerator.Instance;

DataTable dt = dse.GetDataSources();

foreach (DataRow dr in dt.Rows)

{

array.Add(dr["ServerName"]);

}

return (string[])array.ToArray(typeof(string));

}