hi,
i am using datareader in while loop.after executing one loop it tells the error .wat to do... help me..
hi,
i am using datareader in while loop.after executing one loop it tells the error .wat to do... help me..
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Santhosh RajanPosted Mar 23, 2009, 7:51 AM
Yeah Ibrahim is right....u ve to give the code u r trying to do....I'll tell one of situations that u might have caught up in..
1) u might have open a datareader in a while loop.....This will work fine for the first iteration of loop but when the second time the same data reader is in the open state and u r trying read it again which u cannot do and error shows up saying "There's already an open datareader..." so and so wat u ve to do is to close the data reader before the loop iterates the next time by putting the code
DataReader.Close
just after the use of datareader in the loop
If this isnt working, just post the code next time
Ibrahim ErsoyPosted Mar 17, 2009, 2:18 PM
Thanks