Note that there are some explanatory texts on larger screens.

plurals
  1. POC# : Problem with SqlDataSourceEnumerator.Instance.GetDataSources()
    text
    copied!<p>I am trying to enlist all the SQL Server instances (Local and Network) in a ComboBox by using the following code:</p> <pre><code> DataTable dt = null; dt = System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources(); foreach (DataRow dr in dt.Rows) { ComboBox1.Items.Add(dr[0].ToString() + "\\" + dr[1].ToString()); } </code></pre> <p>It works fine on Windows XP 32 Bit, Windows 7 64 Bit by enlisting all of my local and network sql server instances in the combo, but when this piece of code runs on Windows 7 32bit (All Professional version) it takes long time to fetch the instance details and ultimately fails to enlist even a single instance (which i believe due to some sort of TimeOut). The data table does not have even a single row in this case. Thus I want to ask following questions:</p> <ol> <li><p>Does this problem is platform specific or OS specific?</p></li> <li><p>Is it really due to slow network speed/ large no. of server instances on the network?</p></li> <li><p>Is there any alternate to this requirement which is not platform or framework dependent as</p> <p>SmoApplication.EnumAvailableSqlServers(false); // local and Network SQL instances</p> <p>is framewrok dependent.</p></li> </ol> <p>I have got at least 17-20 Network Server of SQL Server which I expect this function to return. Hence I can not understand how this could happen? I am encountering this problem precisely on Windows 7 32bit (Professional version).</p> <p>Thank you</p> <p>Hemant Jaiswal</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload