Bug #19910 Error Msg : There is already an open DataReader associated with this Connection
Submitted: 18 May 2006 12:31 Modified: 23 Jun 2006 12:10
Reporter: h k Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:5.1 OS:Windows (win 2000 server)
Assigned to: CPU Architecture:Any

[18 May 2006 12:31] h k
Description:
Error Msg : There is already an open DataReader associated with this Connection which must be closed first. (occured in aspx page)

Scenerio : i have an output for a storedprocedure which i am supposed to bind to a grid in an aspx page.

Basically I am using SQLHelper class to get the data in which there are some defined methods like ExecuteDataSet and ExecuteDataReader, while using these methods its raising the above error message and coming out from the Adapter class itself.

My Stored procedure includes some Temporary tables and I am dropping the tables after the usage of them.

Provide me some solution ASAP to get rid from the problem.

Thanking You

With Regards
Hem Kumar

How to repeat:
Error Msg : There is already an open DataReader associated with this Connection which must be closed first. (occured in aspx page)

Scenerio : i have an output for a storedprocedure which i am supposed to bind to a grid in an aspx page.

Basically I am using SQLHelper class to get the data in which there are some defined methods like ExecuteDataSet and ExecuteDataReader, while using these methods its raising the above error message and coming out from the Adapter class itself.

My Stored procedure includes some Temporary tables and I am dropping the tables after the usage of them.

Provide me some solution ASAP to get rid from the problem.

Thanking You

With Regards
Hem Kumar
[18 May 2006 14:41] Jorge del Conde
Hi!

Can you please send me a test-case that shows this behaviour ?

Thanks a lot !
[19 May 2006 14:48] h k
Below is the method from where the exception occured.

public static DataSet ExecuteDataset(MySqlConnection connection, CommandType commandType, string commandText, params MySqlParameter[] commandParameters)
		{
			DataSet set2;
			if (connection == null)
			{
				throw new ArgumentNullException("connection");
			}
			MySqlCommand command1 = new MySqlCommand();
			bool flag1 = false;
			PrepareCommand(command1, connection, null, commandType, commandText, commandParameters, out flag1);
			using (MySqlDataAdapter adapter1 = new MySqlDataAdapter(command1))
			{
				DataSet set1 = new DataSet();
				adapter1.Fill(set1);// ERROR OCCURED AT THIS POINT
				command1.Parameters.Clear();
				if (flag1)
				{
					connection.Close();
				}
				set2 = set1;
			}
			return set2;
		}

I can see the output of the stored procedure from querybrowser but i get the exception when i fill the data into the dataset.
[23 May 2006 12:10] Tonci Grgin
Hi, thanks for your problem report. Can you please check following reports:
http://bugs.mysql.com/bug.php?id=7248
and
http://bugs.mysql.com/bug.php?id=19181
and see if you can find the answer there.
[23 Jun 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".