Error in DataReader is not closed
Can anyone help me on how this error came up
There is already an open DataReader associated with this Connection which must be closed first.
the error fails when it trying to read this code.
transConn = mySqlConn.BeginTransaction(IsolationLevel.ReadCommitted)
Is ther开发者_如何学Pythone is a connection between the Datareader and in initializing the transaction?
Can anyone help me on how can I fix this bugs.
Thanks peeps! :)
Close the DataReader before you begin the transaction.
See here: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.close.aspx
It says:
"You must explicitly call the Close method when you are through using the SqlDataReader to use the associated SqlConnection for any other purpose."
精彩评论