title: type used in a using statement must be implicitly convertible to 'System.IDisposable'
body: <p>I have one error in my code listed as: 'DatabaseLayer':type used in a using statement must be implicitly convertible to 'System.IDispsable'.</p>
  
  <p>I tried looking at MSDN and other Stack Overflow questions, but I have not resolved the error. I am using Visual Studio 2015 with .NET Framework 4.5.1.</p>
  
  <p>The error is in line 56, but I have commented above the line with error. Below is the code in my file:</p>
  
  <pre><code>public class UserDataAccessLayer : IDisposable
  {
      public bool Create(string username, string pwd, string email)
      {
          bool retVal = false;
          SqlCommand sqlCmd = new SqlCommand("CreateUser");
          sqlCmd.CommandType = CommandType.StoredProcedure;
          sqlCmd.Parameters.AddWithValue("@Username", username);
          sqlCmd.Parameters.AddWithValue("@Pwd", pwd);
          sqlCmd.Parameters.AddWithValue("@Email", email);
          int result = new DatabaseLayer().ExecuteNonQuery(sqlCmd);
          if (result != Int32.MaxValue)
              retVal = true;
  
          return retVal;
      }
  
      public bool Create(string username, string pwd, string email, int roleId)
      {
          bool retVal = false;
          SqlCommand sqlCmd = new SqlCommand("CreateUser");
          sqlCmd.CommandType = CommandType.StoredProcedure;
          sqlCmd.Parameters.AddWithValue("@Username", username);
          sqlCmd.Parameters.AddWithValue("@Pwd", pwd);
          sqlCmd.Parameters.AddWithValue("@Email", email);
          int result = new DatabaseLayer().ExecuteNonQuery(sqlCmd);
          if (result != Int32.MaxValue)
              retVal = true;
  
          return retVal;
      }
  
      public void Dispose()
      {
          throw new NotImplementedException();
      }
  
      public User GetUserInfo(string username, string pwd)
      {
          User user = null;
          using (DatabaseLayer dbLayer = new DatabaseLayer())
          {
              SqlCommand sqlCmd = new SqlCommand("GetUserInfo");
              sqlCmd.CommandType = CommandType.StoredProcedure;
              sqlCmd.Parameters.AddWithValue("@Username", username);
              sqlCmd.Parameters.AddWithValue("@Pwd", pwd);
              user = dbLayer.GetEntityList&lt;User&gt;(sqlCmd).FirstOrDefault();
          }
          return user;
      }
  }
  </code></pre>