public static void insertarPruebaBK(MySqlConnection conexion, PruebaBK ipbk) { String query = "INSERT INTO bk(IDPRUEBA, NUMEROBK, TIPOBK+, SERIEBK, LABORATORIO, CRB) VALUES ('" + ipbk.idprueba + "','" + ipbk.numerobk + "','" + ipbk.tipobkmas + "','" + ipbk.seriebk + "','" + ipbk.laboratorio + "','" + ipbk.crb + "',)"; try { MySqlCommand comando = new MySqlCommand(query, conexion); Int32 lector = (Int32)comando.ExecuteNonQuery(); } catch (MySqlException ex) { throw ex; } }
private void buttonguardar_Click(object sender, EventArgs e) { try { if (con.conectar()) { Clases.Prueba ip = new Clases.Prueba(Convert.ToInt32(label4), 1); Clases.Prueba.ingresarprueba(con.conexion, ip); Clases.PruebaBK ipbk = new Clases.PruebaBK( ); Clases.PruebaBK.insertarPruebaBK(con.conexion, ipbk); MessageBox.Show("Muestra Ingresada Exitosamente"); } } catch (MySqlException ex) { MessageBox.Show("Error al insertar la muestra" + ex); } con.desconectar(); }