private void txtnom_TextChanged_1(object sender, EventArgs e) { if (radioButton1.Checked && txtnom.TextLength >= 0) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedNom(txtnom.Text.ToUpper()); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else if (radioButton2.Checked && txtCod.TextLength == 0) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedNom(""); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else if (radioButton2.Checked && txtCod.TextLength >= 1) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedCod(txtCod.Text); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else { dataGridView1.DataSource = null; } lblCan.Text = "*"; lblNom.Text = "*"; lblDes.Text = "*"; lblCod.Text = "*"; txtUnidad.Text = "*"; label10.Text = "*"; button1.Enabled = false; btnIng.Enabled = false; btnSac.Enabled = false; }
private void txtCod_TextChanged(object sender, EventArgs e) { if (radioButton2.Checked && txtCod.TextLength >= 1) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedCod(txtCod.Text); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else { dataGridView1.DataSource = null; } }