ADO.Net question
-
I have VS 2008 and have 3 different versions of SQL server running in my network. I tried a sample from the MSDN documents for finding server instances running in the network. http://msdn.microsoft.com/en-us/library/a6t1z9x2.aspx[^] I added using System.Data.Sql; to a simple starter app and a datagridview to the form. In the load event I use this code.. // Retrieve the enumerator instance and then the data. SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance; System.Data.DataTable table = instance.GetDataSources(); dataGridView1.DataSource = table; dataGridView1.Refresh(); when the apps runs it eventually bring back the 3 db server's PC name but the rest of the data (according to the docs should be ServerName, InstanceName, IsClustered, and Version)is not returned. Anybody know why?? tia rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
-
I have VS 2008 and have 3 different versions of SQL server running in my network. I tried a sample from the MSDN documents for finding server instances running in the network. http://msdn.microsoft.com/en-us/library/a6t1z9x2.aspx[^] I added using System.Data.Sql; to a simple starter app and a datagridview to the form. In the load event I use this code.. // Retrieve the enumerator instance and then the data. SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance; System.Data.DataTable table = instance.GetDataSources(); dataGridView1.DataSource = table; dataGridView1.Refresh(); when the apps runs it eventually bring back the 3 db server's PC name but the rest of the data (according to the docs should be ServerName, InstanceName, IsClustered, and Version)is not returned. Anybody know why?? tia rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
I have just tried your code on my system and it works as per the documentation. I cut and pasted your code, so provided that the posted code is accurate, I cannot help. Sorry! :)
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
I have just tried your code on my system and it works as per the documentation. I cut and pasted your code, so provided that the posted code is accurate, I cannot help. Sorry! :)
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Thanks Henry; So you did get the InstanceName, IsClustered, and Version in addition to the the Server names...right? rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
Yes, exactly as the documentation in the link you gave. I would only add, that both the server instances on my system are Express versions 2005 and 2008. Don't know if that would make any difference though.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”