Пример #1
0
        private void cargarDatos()
        {
            AEUSP db   = new AEUSP();
            var   list = db.Sp_Cns_InvActivosAso();

            GVConsulta.DataSource = list;
            GVConsulta.DataBind();
        }
Пример #2
0
        private void filtrarNombre()
        {
            using (SqlConnection cnx = new SqlConnection(@"data source=sql5047.site4now.net;initial catalog=DB_A4F898_AppInventario;persist security info=True;user id=DB_A4F898_AppInventario_admin;password=aeusp1234;"))
            {
                cnx.Open();

                SqlCommand cmd = new SqlCommand("exec[Sp_Cns_InvaAsoPorNombre] @nombre", cnx);
                cmd.Parameters.AddWithValue("@nombre", txtBuscar.Text);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                da.Fill(dt);

                GVConsulta.DataSource = dt;
                GVConsulta.DataBind();
            }
        }