public static void SetInit() { SetList.Clear(); using (DB db = new DB()) { db.Open(Const.MySql_ConnStr); string sql = "select fid,gps_type,gps_id,car_number from tb_car_info where stat=1 and (gps_type=1 or gps_type=2)"; using (DR dr = db.OpenRecord(sql)) { while (dr.Read()) { SetList.Add(new SetObj() { CarID = dr.GetString(0), GPSType = dr.GetInt16(1), GPSID = dr.GetString(2), CarNumber = dr.GetString(3) }); } } } ResetEvent = new AutoResetEvent(false); }