S
Steve Litvack
Hello:
I am using the techniques mentioned elsewhere for using the DataGrid's
custom-paging ability. I have a query that returns only the specific range
of records I request (this range applies, of course, to the current page
being viewed by the user). I want to use a SqlDataReader instead of a
DataSet because I have no need to update the data and SqlDataReader is
purportedly much faster.
When I add a DataGrid to the aspx document, set its AllowCustomPaging to
true, then set its VirtualItemCount to 20 (in Page_Load), then set its
DataSource to my SqlDataReader, then do a DataBind() call, I get this error
message:
--> "Cannot compute Count for a data source that does not implement
ICollection"
I was under the impression that a Count is not attempted by the DataGrid
control when AllowCustomPaging is true--but this apparently is not what I'm
seeing.
I even verified in the debugger that AllowCustomPaging and VirtualItemCount
properties were true and 20, respectively, immediate before the call to
DataBind().
I would be greatful for any help.
-- Steve
I am using the techniques mentioned elsewhere for using the DataGrid's
custom-paging ability. I have a query that returns only the specific range
of records I request (this range applies, of course, to the current page
being viewed by the user). I want to use a SqlDataReader instead of a
DataSet because I have no need to update the data and SqlDataReader is
purportedly much faster.
When I add a DataGrid to the aspx document, set its AllowCustomPaging to
true, then set its VirtualItemCount to 20 (in Page_Load), then set its
DataSource to my SqlDataReader, then do a DataBind() call, I get this error
message:
--> "Cannot compute Count for a data source that does not implement
ICollection"
I was under the impression that a Count is not attempted by the DataGrid
control when AllowCustomPaging is true--but this apparently is not what I'm
seeing.
I even verified in the debugger that AllowCustomPaging and VirtualItemCount
properties were true and 20, respectively, immediate before the call to
DataBind().
I would be greatful for any help.
-- Steve