title: How to list available instances of SQL Servers using SMO in C#?
body: <p>Can anybody explain me what I wrong I am doing in the following piece of code:</p>
  
  <pre><code>DataTable dt=SmoApplication.EnumAvailableSqlServer(true);
  Server sr = new Server("Test");
  
  foreach(DataBase db in sr.DataBases)
  {
      Console.WriteLine(db["name"]);
  }
  </code></pre>
  
  <p>It gives an exception in <code>sr.Databases</code> that can not be connected.</p>