title: List available SQL Servers on network
body: <p>I'm trying to display a list of available SQL serves into a listbox using the following code:</p>
  
  <pre><code>DataTable dt = SqlDataSourceEnumerator.Instance.GetDataSources();
  foreach (DataRow dr in dt.Rows)
  {
      listBox3.Items.Add(string.Concat(dr["ServerName"], "\\", dr["InstanceName"]));
  } 
  </code></pre>
  
  <p>However, this adds nothing to the listBox. While debugging, I found that dt.Rows.Cout is actually equal to zero, even though I have a server on my computer through SQLEXPRESS 2010. Any ideas?</p>
  
  <p>Ok Thank you all for your help. The following code worked best for me:</p>
  
  <pre><code>        ManagedComputer mc = new ManagedComputer();
          mc.ConnectionSettings.ProviderArchitecture = ProviderArchitecture.Use64bit;
          foreach (ServerInstance si in mc.ServerInstances)
          {
              listBox3.Items.Add(Environment.MachineName + "\\" + si.Name);
          }
  </code></pre>