Last post Jul 05, 2011 10:01 AM by caesar123
Jun 04, 2011 07:06 PM|caesar123|LINK
I am experiencing the most strangest issue. Everything works fine in development, but for some reason in the live environment my objectdatasource returns the correct results at times, but intermittently throws out incorrect results. This only occurs during
the paging process, and it only occurs intermittently.
I am using a listview control with two datapagers, and an objectdatasource which calls methods that are implemented using linq to sql to take advantage of the skip and take tolist() functionality.
I have a selecting method for the objectdatasource where i pass the parameters to the selectmethod of the objectdatasource.
Does any one have any idea why the objectdatasource might be throwing back only some results at times, and sometime no results, and at other times the correct results.
Any help will be much appreciated.Thanks
Jun 05, 2011 12:36 AM|nobdy|LINK
Can you post the code for that?
Jun 06, 2011 09:41 PM|Decker Dong - MSFT|LINK
How did you code that? Would you mind showing us your codes?
I think you are now using ObjectDataSource+DataPager in ListView. You can have a look at this nice sample at:
http://forums.asp.net/t/1319208.aspx (please see
Samu Zhang -...'s answer).
Or you can see(LINQ+ObjectDataSource+DataPager)
Jul 04, 2011 12:31 PM|caesar123|LINK
(Sorry for the late response, i was delayed by other tasks.)
Yes i am using a method very similar to the second link you have sent.
One thing i have discovered it that this only happens on the live server and not on my development server. I have also got a live test environment, and it seems to work perfectly fine on there also. The only difference between the actual live server and
the test live server is that the live server is used by many users concurrently. I wonder if this is the issue. Does anyone have a clue about this.
Jul 05, 2011 10:01 AM|caesar123|LINK
I have resolved the problem. It took alot of headbanging, but i eventually narrowed it done to the actual problem, which was the fact that i was caching the totalcount value into a global application level variable. What that meant was that at any time when
the search was used by multiple users, it cached the totalCount, So the search results where produced based on the cahced value for all users.
The solution was to remove the cached value, which im not sure why it was there for in the first place.