want to return datareader from method

Posted by Navalemanoj0405 under Regular Expressions on 4/27/2011 | Points: 10 | Views : 1811 | Status : [Member] | Replies : 4
Dear All

I am trying to return datareader.but its getting closed when I catch it in my code and because of this I cant read it.
is there any solution for the same


please revert...

Thanks




Responses

Posted by: Ndebata on: 4/27/2011 [Member] Starter | Points: 25

Up
0
Down
Hi

Try to remove/comment those lines which are used for connection closing.

If you want you can close the connection only after reading the data from datareader

Navalemanoj0405, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 4/27/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Navalemanoj0405,

show ur code . . so will be we r try to find solution of ur probs . .

Best Regard's
Prabhakar

Navalemanoj0405, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 4/27/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
You can convert the DataReader into DataTableReader and return it. Read more about it http://www.dotnetfunda.com/articles/article987-working-with-datatablereader-class-.aspx.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Navalemanoj0405, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ravi_pinnoju on: 4/27/2011 [Member] Starter | Points: 25

Up
0
Down
You can close the connection after reading the data from the DataReader.

Navalemanoj0405, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response