title: Connection to MDF Local Database Hangs
body: <p>I have established this connection with my database but when I start the program it just hangs:</p>
  
  <pre><code>    System.Data.SqlClient.SqlConnection con;
  
      private void window_loaded(object sender, RoutedEventArgs e)
      {
          con = new System.Data.SqlClient.SqlConnection();
          con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Trial01.mdf;Connect Timeout=30;User Instance=True";
          con.Open();
          MessageBox.Show("Connection opened");
          con.Close();
          MessageBox.Show("Connection closed");
      }
  </code></pre>