Reply
Paging problem
Old 02-09-2006, 08:35 AM Paging problem
Novice Talker

Posts: 8
Hi All

I want to know that is it possible to use paging in data grid
when i use rate reader object to read data from database

when i do so it doesn't work
while with data adopter object it works...
what could be the prob??
hytechpro is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-09-2006, 09:58 AM Re: Paging problem
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
I'm pretty sure that's due to the way the DataReader works. Basically, it reads records one at a time from the database, staying connected to the database, so there's no method to randomly access the records.

You could use one of the other Data objects, such as a DataSet, or you could read the records into a strongly typed custom object (prefered).

If there are a lot of records in the database, you'd be better off using cusom paging to only query the database for the records on the current page, as opposed to retreiving them all and then paging through them.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 02-10-2006, 08:01 AM Re: Paging problem
Novice Talker

Posts: 8
I know that data reader works in connected environment and data adopter reads data in disconnected environment....

R u saying that we cannot store data in dataset object using data reader object????



Quote:
Originally Posted by Minaki
I'm pretty sure that's due to the way the DataReader works. Basically, it reads records one at a time from the database, staying connected to the database, so there's no method to randomly access the records.

You could use one of the other Data objects, such as a DataSet, or you could read the records into a strongly typed custom object (prefered).

If there are a lot of records in the database, you'd be better off using cusom paging to only query the database for the records on the current page, as opposed to retreiving them all and then paging through them.
hytechpro is offline
Reply With Quote
View Public Profile
 
Old 02-11-2006, 06:53 AM Re: Paging problem
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
No, what I'm saying is you can't page through records with an SqlDataReader because of the way it accesses records. You have to move the records into an object that can randomly access the records.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Reply     « Reply to Paging problem
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13379 seconds with 12 queries