Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Datareader for datagrid


Message #1 by "Tom Brzeski" <tom.brzeski@o...> on Tue, 29 May 2001 16:12:33
Can we use datareader instead of dataset so we can get better performance 

and still maintain paging functionality?
Message #2 by "Alex Homer" <alex@b...> on Tue, 29 May 2001 16:55:36
I've been trying this, and in the build I'm using I get the exotic error 

message:



"AllowCustomPaging must be true and VirtualItemCount must be set for a 

DataGrid with ID MyDataGrid when AllowPaging is set to true and the 

selected datasource does not implement ICollection"



The docs say that the DataGrid expects a data source that implements 

IEnumerable, and the DataReader is not one of these. From the error 

message, it looks like you could do it if you implemented custom paging 

rather than relying on the features of the DataGrid control. I haven't 

tried this yet, but it certainly seems worth a go. It means that you'll 

have to manage the data yourself so that you select only the appropriate 

rows from the data source. It may not end up being any more efficient.


  Return to Index