Guest User

Untitled

a guest
Jan 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. void Fillcombo()
  2. {
  3. string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\Stage_ap\BD\MontHoreb.accdb";
  4. conn.ConnectionString = connectionString;
  5. conn.Open();
  6. OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT Code_Marche, Libelle_Marche FROM MARCHE", conn);
  7. DataTable dt = new DataTable();
  8. adapter.Fill(dt);
  9. cmbCodeMaPh.DataSource = dt;
  10. cmbCodeMaPh.DisplayMember = "Libelle_Marche";
  11. conn.Close();
  12. }
Add Comment
Please, Sign In to add comment