Esempio n. 1
0
        public static Festival GetFestival()
        {
            DbDataReader reader = null;

            try
            {
                //if(Database.ConnectionString.ProviderName==dat van mysql)gebruik limit
                reader = Database.GetData("SELECT TOP 1 * FROM Festival");
                Festival festival = null;
                if (reader.Read())
                {
                    festival = new Festival(reader);
                }
                reader.Close();
                reader = null;
                return(festival);
            }
            catch (Exception ex)
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                    reader = null;
                }
                throw new Exception("Could not get festival", ex);
            }
        }
Esempio n. 2
0
 static Festival()
 {
     _festival = new Festival();
 }