//Resets listView per any changes to database public void resetList() { db = new TestEntities1(); lvQuery.BeginUpdate(); lvQuery.Items.Clear(); var queries = db.QueriesTables.ToList(); foreach (var q in queries) { var row = new string[] { q.ID.ToString(), q.StatusID.ToString(), q.TypeID.ToString(), q.Name, q.Description, q.Query, q.Parameters, q.CreateDate.ToString(), q.UpdateDate.ToString() }; var lvi = new ListViewItem(row); lvQuery.Items.Add(lvi); } //lvQuery.Update(); //lvQuery.Refresh(); lvQuery.EndUpdate(); }
public Form1() { InitializeComponent(); db = new TestEntities1(); edit = new string[1]; }