开发者

Error in DataReader is not closed

开发者 https://www.devze.com 2023-01-18 08:02 出处:网络
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.

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."

0

精彩评论

暂无评论...
验证码 换一张
取 消