Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Gridview disappears on paging

$
0
0

I thought I would be worth a try to ask this one more time. Especially since my understanding of what is causing the problem has increased. Although I still dont have the solution. I am using the code below to Query an Entity in the Enyutity Framework using an ObjectQuery. My question is does anyone see anything in my code as far as compatibility issues that would cause the grid view to disappear everytime I click on a number to go to the next page. I have seen countless posts of people having this ame problem. But oddly enough none of the solutions have worked for me. Maybe I need an answer that is specific to the tools that I am using. 1) ObjectQuery 2) Entity Framework 3) Link to Enity. Thanks I need some help with this pretty bad.

        Dim var As ObjectQuery
        Using Context = New ElectronicBillEntities()

            'Used ObjectQuery to query the demographics entity
            var = From demographics In Context.Demographics
                  Order By demographics.LastName
                  Where demographics.LastName.StartsWith(DropDownList1.SelectedValue)
                  Select demographics.MR, demographics.LastName, demographics.FirstName, demographics.DOB, demographics.Active


            GridView1.DataSource = var
            GridView1.DataBind()


        End Using


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>