Invalid attempt to Read when reader is closed.

M

Mike

hi to all,
i meet some problem and didn't find any recommendation to resolve it ,
do you have some idia , how i can resolve this problem,
a lot of thank's ,
Mike

i tried setting to asp:datagrid nullable recordset:
dgVisitAnalysis.DataSource=objVisit.getVisitAnalysisList(VisitID);

dgVisitAnalysis.ShowFooter=true;

dgVisitAnalysis.DataBind();



as result i receive following error:
_________________________
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Invalid attempt to Read
when reader is closed.
Source Error:
Line 93:
//dgVisitAnalysis.DataSource=objVisit.getVisitAnalysisList(VisitID);
Line 94: dgVisitAnalysis.ShowFooter=true;
Line 95: dgVisitAnalysis.DataBind();



on execution i use following code:
//execute the command

myConnection.Open();

SqlDataReader
result=myCommand.ExecuteReader(CommandBehavior.CloseConnection);

//return the datareader result

return result;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top