DataGrid Custom Paging using SQLDataReader

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default DataGrid Custom Paging using SQLDataReader

    Hi Everyone,

    I am trying to implement a DataGrid that uses Custom paging, but the DataSource is a SQLDataReader, not a DataSet. I have seen examples that use the Fill method of a DataAdapter to only retrieve a page of data, eg:

    daCustomers.Fill(dsCustomers, (PageNum - 1) * intPageSize, intPageSize, "Customers")

    But I am having difficulties achieving this using a DataReader. My goal is to have a datagrid that only displays 10 rows of data at a time and allows the user to move between pages as well as allowing the user to sort the data - all without using a DataSet (not for any particular reason - I just want to do it this way)!

    Cheers,

    Paul
    Paul Hobbs Guest

  2. Similar Questions and Discussions

    1. Odd paging problem in custom datagrid control
      Hi there, I have made a custom datagrid control class. its pretty basic, just some styles changed and small things like that... the datagrid is...
    2. Custom Paging in datagrid
      hi all, i have tried implementing custom paging using the example from 4 guys from rolla....however example doesnot work as desired.....i.e when...
    3. More problems with DataGrid Editing while using custom Paging
      All, i am running into more problems with DataGrid, following are my doubts 1) When i scroll to the next page on the dataGrid using my custom...
    4. Datagrid custom paging problem
      After tons of thinking I decided that a dataset for a search could contain far too much info on the server for an ISP to allow, so I decided to do...
    5. Problem with "Custom paging" of DataGrid control
      I created a page to show RealEstate Data with images retrived from the MSSQL 2000. I am using a DataGrid control: <asp:datagrid...
  3. #2

    Default Re: DataGrid Custom Paging using SQLDataReader

    You are attempting to use a DataReader in a way for which it is not intended. DataReaders are for one time forward only reading of data out of a database. You can't "page" a DataReader because you can't go backwards.

    Stick to the DataSet or a DataView based on a DataTable.
    "Paul Hobbs" <paul@mobius.net.au> wrote in message news:uemH6mfUDHA.3308@tk2msftngp13.phx.gbl...
    Hi Everyone,

    I am trying to implement a DataGrid that uses Custom paging, but the DataSource is a SQLDataReader, not a DataSet. I have seen examples that use the Fill method of a DataAdapter to only retrieve a page of data, eg:

    daCustomers.Fill(dsCustomers, (PageNum - 1) * intPageSize, intPageSize, "Customers")

    But I am having difficulties achieving this using a DataReader. My goal is to have a datagrid that only displays 10 rows of data at a time and allows the user to move between pages as well as allowing the user to sort the data - all without using a DataSet (not for any particular reason - I just want to do it this way)!

    Cheers,

    Paul
    Chuck Haeberle Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139