public void LlenarGridFichaIdentificacion() { /*SqlConnection cnn = new SqlConnection(ConfigurationManager.AppSettings.Get("strConnection"));*/ /* SqlConnection cnn = new SqlConnection(ConfigurationManager.AppSettings.Get("strConnection"));*/ string conexion = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString; SqlConnection cnn; cnn = new SqlConnection(conexion); cnn.Open(); SqlCommand comando = new SqlCommand("SP_Catalogo_FichaIdentificacion2", cnn); comando.CommandType = CommandType.StoredProcedure; comando.Parameters.AddWithValue("@Opcion", "LISTADO"); if (txtBuscar_FichaIdentificacion.Text == "") { comando.Parameters.AddWithValue("@Nombre_FichaIdentificacion", ""); } else { comando.Parameters.AddWithValue("@Nombre_FichaIdentificacion", txtBuscar_FichaIdentificacion.Text); } /* * 0 Id_Empresa * 1 Nombre_Empresa */ SqlDataAdapter da = new SqlDataAdapter(comando); DataTable ds = new DataTable(); da.Fill(ds); Grid_FichaIdentificacion.Visible = true; Grid_FichaIdentificacion.DataSource = ds; Grid_FichaIdentificacion.Columns[0].Visible = true; Grid_FichaIdentificacion.Columns[1].Visible = true; Grid_FichaIdentificacion.DataBind(); ds.Dispose(); da.Dispose(); cnn.Close(); }
public void LlenarGridFichaIdentificacion() { string conexion = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString; SqlConnection cnn; cnn = new SqlConnection(conexion); cnn.Open(); SqlCommand comando = new SqlCommand("SP_Catalogo_FichaIdentificacion", cnn); comando.CommandType = CommandType.StoredProcedure; comando.Parameters.AddWithValue("@Opcion", "LISTADO"); if (txtBuscar_FichaIdentificacion.Text == "") { comando.Parameters.AddWithValue("@Nombre_FichaIdentificacion", ""); } else { comando.Parameters.AddWithValue("@Nombre_FichaIdentificacion", txtBuscar_FichaIdentificacion.Text); } /* * 0 Id_Empresa * 1 Nombre_Empresa */ SqlDataAdapter da = new SqlDataAdapter(comando); DataTable ds = new DataTable(); da.Fill(ds); Grid_FichaIdentificacion.Visible = true; Grid_FichaIdentificacion.DataSource = ds; Grid_FichaIdentificacion.Columns[0].Visible = true; Grid_FichaIdentificacion.Columns[1].Visible = true; Grid_FichaIdentificacion.DataBind(); Grid_FichaIdentificacion.HeaderRow.Cells[0].Attributes["data-class"] = "expand"; Grid_FichaIdentificacion.HeaderRow.Cells[2].Attributes["data-hide"] = "phone"; Grid_FichaIdentificacion.HeaderRow.TableSection = TableRowSection.TableHeader; ds.Dispose(); da.Dispose(); cnn.Close(); }
public void LlenarGridFichaIdentificacion() { /*SqlConnection cnn = new SqlConnection(ConfigurationManager.AppSettings.Get("strConnection"));*/ /* SqlConnection cnn = new SqlConnection(ConfigurationManager.AppSettings.Get("strConnection"));*/ string conexion = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString; SqlConnection cnn; cnn = new SqlConnection(conexion); cnn.Open(); SqlCommand comando = new SqlCommand("SP_Catalogo_FichaIdentificacion", cnn); comando.CommandType = CommandType.StoredProcedure; comando.Parameters.AddWithValue("@Opcion", "LISTADO"); if (!(txtBuscar_FichaIdentificacion.Text == "")) { string s = txtBuscar_FichaIdentificacion.Text; string[] palabras = s.Split(' '); int i = 0; foreach (string palabra in palabras) { if (i <= 2) { string NDescripcion = "@Nombre_FichaIdentificacion" + i; comando.Parameters.AddWithValue(NDescripcion, palabra); i++; } } } else { comando.Parameters.AddWithValue("@Nombre_FichaIdentificacion0", ""); } /* * 0 Id_Empresa * 1 Nombre_Empresa */ SqlDataAdapter da = new SqlDataAdapter(comando); DataTable ds = new DataTable(); da.Fill(ds); Grid_FichaIdentificacion.Visible = true; Grid_FichaIdentificacion.DataSource = ds; Grid_FichaIdentificacion.Columns[0].Visible = true; Grid_FichaIdentificacion.Columns[1].Visible = true; Grid_FichaIdentificacion.DataBind(); //Grid_FichaIdentificacion.HeaderRow.Cells[0].Attributes["data-class"] = "expand"; //Grid_FichaIdentificacion.HeaderRow.Cells[2].Attributes["data-hide"] = "phone"; //Grid_FichaIdentificacion.HeaderRow.Cells[3].Attributes["data-hide"] = "phone"; //Grid_FichaIdentificacion.HeaderRow.TableSection = TableRowSection.TableHeader; ds.Dispose(); da.Dispose(); cnn.Close(); txtBuscar_FichaIdentificacion.Focus(); }