コード例 #1
0
 private void btn_eliminar_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgv_categoria.SelectedRows.Count == 1)
         {
             int     id = Convert.ToInt16(dgv_categoria.CurrentRow.Cells[0].Value);
             negocio n  = new negocio();
             n.EliminarCategoria(id);
         }
         else
         {
             MessageBox.Show("Debe de seleccionar una fila");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }