title: In Entity Framework 4.0 "Nested transactions are not supported" error is displayed?
body: <p>An error occurred while starting a transaction on the provider connection. See the inner exception for details. "Nested transactions are not supported."
  Inner Exception </p>
  
  <pre><code>public bool Insert(myModel model)
  {
              entities.Database.Connection.Open();
              using (DbTransaction trans = entities.Database.Connection.BeginTransaction())
              {
                  try
                  {
                      table1 obj1 = new table1
                      {
                          AccountHolderName = model.AccountHolderName,
                          AccountNumber = model.AccountNumber,
                          Address = model.Address,
                      };
                      entities.table1.Add(obj1);
                      entities.SaveChanges();
  
                      long id = obj1.ID;
  
                      table2 obj = new table2
                      {
                          ID = model.ID == 1 ? id : model.ID,
                          Username = model.Email,
                          Password = model.Password,
                      };
                      entities.table2.Add(obj2);
                      entities.SaveChanges();
                      trans.Commit();
                  }
                  catch (Exception)
                  {
                      trans.Rollback();
                  }
                  finally
                  {
                      entities.Database.Connection.Close();
                  }
             }
  }
  </code></pre>