예제 #1
0
파일: Form1.cs 프로젝트: hunk2109/t6
        private void txtbusc_TextChanged(object sender, EventArgs e)
        {
            conccion oper = new conccion();

            if (cmbbuscar.Text == ("ID"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where u_id like '%" + txtbusc.Text + "%'");
            }
            else if (cmbbuscar.Text == ("Nombre"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where nombre like '%" + txtbusc.Text + "%'");
            }
            else if (cmbbuscar.Text == ("Apellido"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where apellido like '%" + txtbusc.Text + "%'");
            }

            else if (cmbbuscar.Text == ("Direccion"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where direccion like '%" + txtbusc.Text + "%'");
            }

            else if (cmbbuscar.Text == ("Telefono"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where telefono like '%" + txtbusc.Text + "%'");
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: hunk2109/t6
        private void btnbuscarx_Click(object sender, EventArgs e)
        {
            conccion oper = new conccion();

            if (cmbbuscar.Text == ("ID"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where u_id like '%" + txtbusc.Text + "%'");
            }
            else if (cmbbuscar.Text == ("Nombre"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where nombre like '%" + txtbusc.Text + "%'");
            }
            else if (cmbbuscar.Text == ("Apellido"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where apellido like '%" + txtbusc.Text + "%'");
            }

            else if (cmbbuscar.Text == ("Direccion"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where direccion like '%" + txtbusc.Text + "%'");
            }

            else if (cmbbuscar.Text == ("Telefono"))
            {
                dgbc.DataSource = oper.consulataconresul("select * from usuario where telefono like '%" + txtbusc.Text + "%'");
            }

            else
            {
                MessageBox.Show("No se encontro nada ");
            }
        }
예제 #3
0
파일: Form1.cs 프로젝트: hunk2109/t6
        private void Form1_Load(object sender, EventArgs e)
        {
            conccion cnx = new conccion();

            dgbc.DataSource = cnx.consulataconresul("select * from usuario");
        }