private void UpdateDatabase() { int companyId = Int32.Parse(hdfCompanyId.Value); DB.Open(); DB.BeginTransaction(); try { // Save hotels HotelsSetupHotelsSetup hotelsSetupHotelsSetup = new HotelsSetupHotelsSetup(hotelsSetupTDS); hotelsSetupHotelsSetup.Save(companyId); DB.CommitTransaction(); // Store datasets hotelsSetupTDS.AcceptChanges(); Session["hotelsSetupTDS"] = hotelsSetupTDS; } catch (Exception ex) { DB.RollbackTransaction(); string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' ')); Response.Redirect(url); } }