private void Consultar() { try { string strInstancia = "SEBASTIAN\\SQLEXPRESS"; string strValor = this.txtCodAeropuerto.Text.Trim(); SqlConnection objCon = new SqlConnection("Data Source = " + strInstancia + "; Initial Catalog = CONTROLVUELO; Integrated Security = SSPI;"); SqlDataAdapter objDA = new SqlDataAdapter("SELECT * FROM tblAEROPUERTO WHERE CODIGO LIKE '%" + strValor + "%' OR NOMBRE LIKE '%" + strValor + "%' OR CIUDAD LIKE '%" + strValor + "%' OR PAIS LIKE '%" + strValor + "%' OR ID_RESPONSABLE LIKE '%" + strValor + "%' OR ESTADO LIKE '%" + strValor + "%'", objCon); DataTable dt = new DataTable(); objDA.Fill(dt); this.GridVPV.DataSource = dt; GridVPV.DataBind(); objCon = null; } catch (Exception ex) { this.lblMensaje.Text = ex.Message; this.pnlAlerta.Visible = true; return; } }
private void Consultar() { try { string strValor = this.txtCodVuelo.Text.Trim(); string strInstancia = "SEBASTIAN\\SQLEXPRESS"; SqlConnection objCon = new SqlConnection("Data Source = " + strInstancia + "; Initial Catalog = CONTROLVUELO; Integrated Security = SSPI;"); SqlDataAdapter objDA = new SqlDataAdapter("SELECT * FROM tblVUELO WHERE CODIGO LIKE '%" + strValor + "%' OR FECHA_partida LIKE '%" + strValor + "%' OR FECHA_llegada LIKE '%" + strValor + "%' OR PLAZAS_VACIAS LIKE '%" + strValor + "%' OR IDPILOTO LIKE '%" + strValor + "%' OR COD_AVION LIKE '%" + strValor + "%'", objCon); DataTable dt = new DataTable(); objDA.Fill(dt); this.GridVPV.DataSource = dt; GridVPV.DataBind(); objCon = null; } catch (Exception ex) { this.lblMensaje.Text = ex.Message; this.pnlAlerta.Visible = true; return; } }
private void Consultar() { try { string strValor = this.txtCodPlanV.Text.Trim(); string strInstancia = "SEBASTIAN\\SQLEXPRESS"; SqlConnection objCon = new SqlConnection("Data Source = " + strInstancia + "; Initial Catalog = CONTROLVUELO; Integrated Security = SSPI;"); SqlDataAdapter objDA = new SqlDataAdapter("SELECT * FROM tblPROGRAMA_VUELO WHERE CODIGO LIKE '%" + strValor + "%' OR CODIGO_VUELO LIKE '%" + strValor + "%' OR CODIGO_ESCALATECNICA LIKE '%" + strValor + "%' OR CODIGO_LINEA LIKE '%" + strValor + "%' OR AEROPUERTO_PARTIDA LIKE '%" + strValor + "%' OR AEROPUERTO_DESTINO LIKE '%" + strValor + "%'", objCon); DataTable dt = new DataTable(); objDA.Fill(dt); this.GridVPV.DataSource = dt; GridVPV.DataBind(); objCon = null; } catch (Exception ex) { this.lblMensaje.Text = ex.Message; this.pnlAlerta.Visible = true; return; } }
private bool LlenarGrid() { try { string strInstancia = "SEBASTIAN\\SQLEXPRESS"; string strValor = this.txtCodAeropuerto.Text.Trim(); SqlConnection objCon = new SqlConnection("Data Source = " + strInstancia + "; Initial Catalog = CONTROLVUELO; Integrated Security = SSPI;"); SqlDataAdapter objDA = new SqlDataAdapter("SELECT * FROM tblAEROPUERTO", objCon); DataTable dt = new DataTable(); objDA.Fill(dt); this.GridVPV.DataSource = dt; GridVPV.DataBind(); objCon = null; return(true); } catch (Exception ex) { this.lblMensaje.Text = ex.Message; this.pnlAlerta.Visible = true; return(false); } }