private void PopulateDGV() { try { ContactsBL contactsBL = new ContactsBL(); dataGridView1.DataSource = contactsBL.GetListOfContacts(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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; } }