private void btmodificar_Click(object sender, EventArgs e) { suplidores.modificar = true; foreach (DataGridViewRow fila in dataGridView1.SelectedRows) { try { suplidores.idmodificar = fila.Cells[0].Value.ToString(); } catch (Exception) { } } Form f = new suplidores(); f.ShowDialog(); operacion oper = new operacion(); DataTable dt = new DataTable(); dt = oper.ExtraeData("SELECT * FROM suplidores;"); dataGridView1.DataSource = dt; dataGridView1.Refresh(); }
private void ConsultaSuplidores_Load(object sender, EventArgs e) { operacion oper = new operacion(); DataTable dt = new DataTable(); dt = oper.ExtraeData("SELECT * FROM suplidores;"); dataGridView1.DataSource = dt; dataGridView1.Refresh(); dataGridView1.Columns[0].ReadOnly = true; if (mantenimiento) { Form f = new suplidores(); this.Hide(); f.ShowDialog(); if (!mantenimiento2) { this.Close(); } else { } mantenimiento = false; mantenimiento2 = false; } else { } }