Click here to Skip to main content
15,887,346 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I had a very basic doubt.

how to display a one million of data into gridview.

i have idea about the gridview paging,but just doing simply gridview paging will do

work, and every time the network round trip happen to the server.


and i just aware of sql server paging.

how to do ,

My Dear Techies,

Kindly Revert me.

Regards
James
Posted

You really don't need and should not bring back millions of rows. No one will ever need to see that much data and wouldn't know what to do with it anyway.

Bring back a few hundred rows, at most; perhaps a pre-filtered subset that would be relevant to the user at that point in time. If they need to see more or different records give them a filter (can be quite comprehensive) and they can then pull back the actual records they need to see rather than everything which would take ages and be overwhelming.

There are many different ways to accomplish this functionality so I'll leave it to you to do your research and figure out which method suits your requirement.

Good luck.
 
Share this answer
 
Comments
jameschowdaree 16-Aug-12 12:28pm    
Im Expected This,I got it
R. Giskard Reventlov 16-Aug-12 12:37pm    
Paging is not the answer, at least not for millions of records. You can certainly page a few hundred.
after 29 min google found a very easy for this.

using linq is one of solution for this.

Custom Paging in GridView Using LINQ.
C#
public IQueryable BindEmployees(int startRowIndex, int maximumRows)
    {
        EmployeeInfoDataContext dbEmp = new EmployeeInfoDataContext();
        var query = from emp in dbEmp.Employees
                    join dept in dbEmp.Departments
                        on emp.DeptID equals dept.DeptID
                    select new
                    {
                        EmpID = emp.EmpID,
                        EmpName = emp.EmpName,
                        Age = emp.Age,
                        Address = emp.Address,
                        DeptName = dept.DepartmentName
                    };
 
        return query.Skip(startRowIndex).Take(maximumRows);
    } 

http://www.codedigest.com/Articles/ASPNET/153_Custom_Paging_for_GridView_using_LINQ.aspx[^]
 
Share this answer
 
v2
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900