Hi Edward,
From your description, you used the DataReader to retrieve some records
from database and bind them in a webform datagrid so as to populate in a
webform page. But you found that everytime the displayed grid will lose the
first record, yes?
As for this problem, I think we can first perform the following things:
1. What's the back DBserver you're using? SQlServer or anyother ? If
SQLserver, you can try running the stored procedure in the QueryAnalyzer
tool first to see whether it really return back all the correct records.
Also, you can do a manually loop on the DataReader and try printout all the
records in page's output (rather than bind to datagrid ) to confirm this.
2.If the SP and DataReader really return the correct data records, we
should do further throubleshoot on the datagrid's binding code. I think you
can add some break points in the datagrid's ItemDataBound event since each
time a record is bind to a gridline, the event will be fired, so that you
can see whether the first record is actually binded or not.
If you have any other findings, please also feel free to post here. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx