private static void ResetDB() { db.MakeBackup(); char scelta; Console.Write("This operation delete the all Database, are you sure? (Y/n) "); scelta = Char.ToUpper(Console.ReadKey().KeyChar); Console.Write("\n"); if (scelta == 'Y') { try { Console.Clear(); if ( CallExecuteSqlScript("DropTeams") && CallExecuteSqlScript("DropDrivers") && CallExecuteSqlScript("DropCountries") && CallExecuteSqlScript("DropCircuits") && CallExecuteSqlScript("DropRaces") && CallExecuteSqlScript("DropRacesScores") && CallExecuteSqlScript("DropScores") && CallExecuteSqlScript("CreateCountries") && CallExecuteSqlScript("CreateTeams") && CallExecuteSqlScript("CreateDrivers") && CallExecuteSqlScript("CreateCircuits") && CallExecuteSqlScript("CreateRaces") && CallExecuteSqlScript("CreateRacesScores") && CallExecuteSqlScript("CreateScores") && CallExecuteSqlScript("SetConstraints") ) { Console.WriteLine("DATABASE Reset completed\n"); } else { throw new Exception(); } } catch (Exception ex) { Console.WriteLine($"Sorry, something went wrong. - {ex.Message}"); RestoreDB(); } } else if (scelta == 'N') { Console.WriteLine("The database won't be deleted."); } else { Console.WriteLine("Uncorrect choice."); } }