Exemple #1
0
        public static TimeZoneInfo[] GetZones(DBHelper dbh, int langId)
        {
            List<TimeZoneInfo> list = new List<TimeZoneInfo>();

            using (IDataReader reader = dbh.RunSPDataReader("TimeZonesGet", DBHelper.MP("@LanguageId", SqlDbType.Int, langId)))
            {
                while (reader.Read())
                {
                    TimeZoneInfo item = new TimeZoneInfo();

                    item.TimeZoneId = (int)reader["TimeZoneId"];
                    item.Bias = (int)reader["Bias"];
                    item.StandardBias = (int)reader["StandardBias"];
                    item.DaylightBias = (int)reader["DaylightBias"];
                    item.DaylightMonth = (int)reader["DaylightMonth"];
                    item.DaylightDayOfWeek = (int)reader["DaylightDayOfWeek"];
                    item.DaylightWeek = (int)reader["DaylightWeek"];
                    item.DaylightHour = (int)reader["DaylightHour"];
                    item.StandardMonth = (int)reader["StandardMonth"];
                    item.StandardDayOfWeek = (int)reader["StandardDayOfWeek"];
                    item.StandardWeek = (int)reader["StandardWeek"];
                    item.StandardHour = (int)reader["StandardHour"];

                    list.Add(item);
                }
            }

            return list.ToArray();
        }
Exemple #2
0
		public static ArrayList GetDatabases(string connectionString)
		{
			ArrayList ret = new ArrayList();
			DBHelper dbh = new DBHelper(connectionString);
			using (IDataReader reader = dbh.RunSPDataReader("sp_databases"))
			{
				while (reader.Read())
					ret.Add(reader["DATABASE_NAME"].ToString());
			}
			return ret;
		}