Advertisement

10.16.2007 at 11:54AM PDT, ID: 22897089
[x]
Attachment Details

Populate gridview with datareader in asp.net

Asked by mugsey in .NET, Programming for ASP.NET, Visual Studio .NET 2005

Tags: gridview, datareader, populate

If I populate a gridview with a DATAREADER and say set the gridview to 20 rows page page.  If I have 2,000 rows in the reader can I iterate through ALL of the rows in the datareader?

For example

    foreach (GridViewRow row in this.gridView.Rows)
        {
            DataRowView drv = row.DataItem as DataRowView;
            EmailMessage message = new EmailMessage();
            etc etc etc

So even though I am only showing the inital 20 rows will the code above iterate through all 2,000?  Also can I do sorting on this?Start Free Trial
[+][-]10.16.2007 at 12:10PM PDT, ID: 20088152

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Programming for ASP.NET, Visual Studio .NET 2005
Tags: gridview, datareader, populate
Sign Up Now!
Solution Provided By: srivatsavaye
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.16.2007 at 12:51PM PDT, ID: 20088465

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.16.2007 at 01:36PM PDT, ID: 20088832

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.17.2007 at 05:25AM PDT, ID: 20092539

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.17.2007 at 06:18AM PDT, ID: 20092922

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.17.2007 at 08:02AM PDT, ID: 20094110

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628