private void btnGuardar_Click(object sender, EventArgs e) { try { if (txtCateg.Text == "") { MessageBox.Show(" No ingreso la Categoría, favor revise la información", "Registro Categoría fallo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { cbo = new CategoriaBO(); Categoria mc = new Categoria() { NombreCategoria = txtCateg.Text, }; cbo.IngresarCategoria(mc); dataGridCateg.DataSource = cbo.GetCateg(); this.dataGridCateg.Columns[0].Visible = false; } } catch (Exception) { MessageBox.Show(" Faltan datos, favor revise la informacion", "Registro Categoría fallo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }