public void buscar() { modProducto modProducto = new modProducto(); try { string operacion; operacion = "WHERE Codigo LIKE '%" + txtBuscar.Text + "%' OR Descripcion LIKE '%" + txtBuscar.Text + "%' OR Marca like '%" + txtBuscar.Text + "%' OR Categoria like '%" + txtBuscar.Text + "%'"; grilla.DataSource = modProducto.cargarProductoTabla(operacion).Tables["rsProducto"]; } catch (MySqlException ex) { MessageBox.Show(ex.StackTrace); } }
private void frmBuscarProducto_Load(object sender, EventArgs e) { modProducto modProducto = new modProducto(); grilla.DataSource = modProducto.cargarProductoTabla("").Tables["rsProducto"]; }