private void cmdAsociar_Click(object sender, EventArgs e) { try { if (int.Parse(dg_AutoresClientes.Rows[dg_AutoresClientes.CurrentCell.RowIndex].Cells[0].Value.ToString()) > 0) { string Cod_Contrato = dg_AutoresClientes.Rows[dg_AutoresClientes.CurrentCell.RowIndex].Cells[0].Value.ToString(); string Id_autor = dg_AutoresClientes.Rows[dg_AutoresClientes.CurrentCell.RowIndex].Cells[1].Value.ToString(); Form frmClientes = new frmClientes(); frmClientes.ShowDialog(); if (ContratoActual.ACTION == "OK") { maestro2.CODIGO_CONTRATO = Cod_Contrato; maestro2.ID_AUTOR = Id_autor; maestro2.ID_CLIENTE = ContratoActual.ID_CLIENTE; maestro2.ERRORES = ""; maestro2.UpdateClientesAutores(maestro2); LeeDatos(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }