title: what is Microsoft.Practices.EnterpriseLibrary.Data
body: <p>I want to know what <code>Microsoft.Practices.EnterpriseLibrary.Data.dll</code> is and why we use this assembly.</p>
  
  <p>What are the benefits of this dll?</p>
  
  <p>I want to create a project on 3-tier architecture and am curious on what is the best way for performing sql queries.</p>
  
  <p>Whether I should use this dll or go for simple <code>SqlCommand</code> and <code>DataAdapter</code>.
  Currently I am working in this way:
  (Code in DAL file:)</p>
  
  <pre><code>public void Insert(long id)
  {
      connection.Open();
      SqlCommand dCmd = new SqlCommand("test_procedure", connection);
      dCmd.CommandType = CommandType.StoredProcedure;
      try
      {
          dCmd.Parameters.AddWithValue("@id", id);           
          dCmd.ExecuteNonQuery();
      }
      catch
      {
          throw;
      }
      finally
      {
          dCmd.Dispose();
          connection.Close();
          connection.Dispose();
      }
  }
  </code></pre>
  
  <p>I am confused whether I am working in a proper way or should if I should better use <code>Microsoft.Practices.EnterpriseLibrary.Data</code> and work with a <code>DatabaseFactory</code>.</p>