Re: "There is already an open DataReader associated with this Connection which must be closed first." with MySqlCommandBuilder
Posted by: Yvan Rodrigues
Date: December 16, 2006 11:59AM

Although this gives me a sense of what you are trying to accomplish, could you add the code that would show how your application might use this class. That would give a better sense of what you are trying to accomplish with this class.

I suspect that this is not a MySQL bug, but a simple execution error; perhaps one of your member methods is accidentally getting run twice.

I would also recommend removing the conn.Open() line and add pooling=true to your connectionstring. This you don't need to worry about whether or not each connection gets opened/closed on da.Fill/da.Update calls because they will do it for you. This seems counterintuitive because you would think it would slow things down to open and close all those connections, but in fact since pooling is on, the connection will actually remain open the whole time.

Whether you use pooling or not, you will want to add exception handling on your Fill and Update commands in case that open connection becomes invalid/closed.

Options: ReplyQuote


Subject
Written By
Posted
Re: "There is already an open DataReader associated with this Connection which must be closed first." with MySqlCommandBuilder
December 16, 2006 11:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.