private void btnFind_Click(object sender, EventArgs e) { this.Hide(); FormBusquedaE abrir = new FormBusquedaE(); abrir.enviarDato = tbBuscar.Text; abrir.Show(); }
private void btnFind_Click(object sender, EventArgs e) { miconexion.Open(); SqlCommand consulta = new SqlCommand("select * from tblEmpresa where Nombre = '"+tbBuscar.Text+ "'", miconexion); SqlDataReader ejecuta = consulta.ExecuteReader(); if (ejecuta.Read() == true) { this.Hide(); FormBusquedaE abrir = new FormBusquedaE(); abrir.enviarDato = tbBuscar.Text; abrir.Show(); } else { MessageBox.Show("Empresa no encontrada, verifique nuevamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); tbBuscar.Clear(); } miconexion.Close(); }
private void btnFind_Click(object sender, EventArgs e) { miconexion.Open(); SqlCommand consulta = new SqlCommand("select * from tblEmpresa where Nombre = '" + tbBuscar.Text + "'", miconexion); SqlDataReader ejecuta = consulta.ExecuteReader(); if (ejecuta.Read() == true) { this.Hide(); FormBusquedaE abrir = new FormBusquedaE(); abrir.enviarDato = tbBuscar.Text; abrir.Show(); } else { MessageBox.Show("Empresa no encontrada, verifique nuevamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); tbBuscar.Clear(); } miconexion.Close(); }