Cycle de progression Faire (quelque chose qui marche) -> comprendre ce que l’on fait/comment cela marche -> pousser plus loin les notions
DataTable <---> DataReader
| Persistance.OleDb.CONTACT oContact; oContact = new Persistance.OleDb.CONTACT(); Persistance.OleDbConnecte.sCONNECTIONSTRING = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsromagnyMes documentsContacts.mdb"; System.Data.DataTable oDataTable; oDataTable = new DataTable(); oDataTable.Load(oContact.ChargerCONTACTs()); //oContact.ChargerCONTACTs() est une méthode retournant un datareader // Affichage comboBox1.DataSource = oDataTable; comboBox1.ValueMember = "nom_contact"; |
| System.Data.Common.DbDataReader oDbDataReader; oDbDataReader = oDataTable.CreateDataReader(); while (oDbDataReader.Read()) { comboBox2.Items.Add(oDbDataReader["nom_contact"]); } oDbDataReader.Close(); |