public override bool Load() { bool ret = true; List <long> idlist = new List <long>(); if (Common.Conn == null) { Common.Conn = new SQLiteConnection(Common.ConnectionString); Common.Conn.Open(); } SQLiteDataReader myReader = null; SQLiteCommand myCommand = new SQLiteCommand(); try { myReader = null; myCommand.CommandText = @"SELECT * FROM [tblMeter] WHERE [DisplayID]= " + m_DisplayID_tblDisplay.DisplayID + " order by oIndex;"; myCommand.Connection = Common.Conn; myReader = myCommand.ExecuteReader(); while (myReader.Read()) { idlist.Add(myReader.GetInt64(myReader.GetOrdinal("ID"))); } myReader.Close(); myCommand.Dispose(); foreach (long id in idlist)// (int i = 0; i < count ; i++) { tblMeter tblmeter = new tblMeter(); tblmeter.ID = id; tblmeter.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay; tblmeter.Select(); Add(tblmeter); } } catch (SQLiteException ae) { System.Windows.Forms.MessageBox.Show(ae.Message); return(false); } return(ret); }
public bool Contains(tblMeter item) { return(List.Contains(item)); }
public int IndexOf(tblMeter item) { return(List.IndexOf(item)); }
public void Insert(int index, tblMeter item) { List.Insert(index, item); this.OntblMeterChanged(EventArgs.Empty); }
public void Remove(tblMeter item) { List.Remove(item); this.OntblMeterChanged(EventArgs.Empty); }
public void Add(tblMeter item) { List.Add(item); this.OntblMeterChanged(EventArgs.Empty); }