title: SqlConnection as a static singleton object
body: <pre><code>public class db
  {
      public static string connectionString =
             WebConfigurationManager.ConnectionStrings["connectString"].ConnectionString;
      public static SqlConnection OpenConnection() 
      {
          SqlConnection connection = new SqlConnection(connectionString);
          connection.Open();
          return connection;
      }
  }
  </code></pre>
  
  <p>I see code like this and it screams WRONG! It's for an ASP.NET (2.0). I understand it to be wrong. </p>
  
  <p>For one you shouldn't open the SqlConnection and return it and two why would you make a static SqlConnection? Won't that create problems if multiple people are trying use it at the same time?</p>