Пример #1
0
        private void txtCod_TextChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtCod.Text) == false)
            {
                txtdescripcion.Clear();
            }

            if (radioSerNombre.Checked && txtnom.TextLength >= 1)
            {
                Base_de_datos busc = new Base_de_datos();
                busc.BuscarSerNom(txtnom.Text.ToUpper());
                dataGridView1.DataSource = busc.Mostrar_Resultados();
            }

            else if (radioSerCodigo.Checked && txtCod.TextLength >= 1)
            {
                Base_de_datos busc = new Base_de_datos();
                busc.BuscarSerCod(txtCod.Text);
                dataGridView1.DataSource = busc.Mostrar_Resultados();
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }