private void Listar() { modalidadesDTO = new ModalidadesDTO(); modalidadesDTO.opcion = 0; modalidadesDAO = new ModalidadesDAO(modalidadesDTO); Dtt = new DataTable(); Dtt = modalidadesDAO.Listar(); if (Dtt.Rows.Count > 0) { dtmodalidades.DataSource = Dtt; } }
private void ListarModalidades() { modalidadesDTO = new ModalidadesDTO(); modalidadesDTO.opcion = 0; modalidadesDAO = new ModalidadesDAO(modalidadesDTO); Dtt = new DataTable(); Dtt = modalidadesDAO.Listar(); if (Dtt.Rows.Count > 0) { cmbmodalidades.DataSource = Dtt; DataRow dataRow = Dtt.NewRow(); dataRow["nombre"] = "Seleccione"; Dtt.Rows.InsertAt(dataRow, 0); cmbmodalidades.DisplayMember = "nombre"; cmbmodalidades.ValueMember = "id"; } }