Wrox Programmer Forums
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2004, 05:54 AM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help....

Hey Guys,

Can you help me with this exception.

I'm using VS.NET interfacin with MySql.

There is already an open DataReader associated with this Connection which must be closed first.
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: There is already an open DataReader associated with this Connection which must be closed first.

Source Error:


Line 81: OdbcDataReader myReader;
Line 82:
Line 83: myReader = myCommand.ExecuteReader();
Line 84: myReader.Close();
Line 85:



 
Old October 29th, 2004, 05:56 AM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is that part of the code...

private void CheckUser(/*OdbcConnection MyConn*/)
        {

            string mySelectQuery = "SELECT * FROM account_details";
            OdbcConnection myConnection = new OdbcConnection();
            myConnection.ConnectionString = "DSN=SystemSource;UID=akramm;PWD=rootuser";
            OdbcCommand myCommand = new OdbcCommand(mySelectQuery,myConnection);
            myConnection.Open();
            OdbcDataReader myReader;

            myReader = myCommand.ExecuteReader();
            myReader.Close();










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.