コード例 #1
0
 private void PopulateDGV()
 {
     try
     {
         ContactsBL contactsBL = new ContactsBL();
         dataGridView1.DataSource = contactsBL.GetListOfContacts();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #2
0
 private void PopulateDDL()
 {
     try
     {
         ContactsBL contactsBL = new ContactsBL();
         ddlContacts.DataSource     = contactsBL.GetListOfContacts();
         ddlContacts.DataValueField = "ContactID";
         ddlContacts.DataTextField  = "FirstName";
         ddlContacts.DataBind();
     }
     catch (Exception ex)
     {
         lblMessage.Text = ex.Message;
     }
 }