static public void GetCategoriessFromDatabase(ComboBox addLinksCb, ComboBox searchCb) { MySqlDataReader reader = DBconnection.ExecuteReader("SELECT * FROM categorie"); while (reader.Read()) { Categorie sort = new Categorie(reader.GetInt64(0), reader.GetString(1)); categories.Add(sort); } reader.Close(); AddSortToBoxes(addLinksCb, searchCb); }
static public void GetLinksFromDatabase(ListBox listbox) { MySqlDataReader reader = DBconnection.ExecuteReader("SELECT * FROM link"); links.Clear(); while (reader.Read()) { Link link = new Link(reader.GetInt64(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetInt16(4), reader.GetInt16(5)); links.Add(link); } reader.Close(); AddLinksToListBox(listbox); }
static public void GetCollectionsFromDatabase(ComboBox addLinksCb, ComboBox searchCb, ComboBox videosCb, ComboBox delete) { MySqlDataReader reader = DBconnection.ExecuteReader("SELECT * FROM collection ORDER BY collectionId ASC;"); collections.Clear(); while (reader.Read()) { Collection collection = new Collection(reader.GetInt64(0), reader.GetString(1)); collections.Add(collection); } reader.Close(); AddCollectionToBoxes(addLinksCb, searchCb, videosCb, delete); }