From: Date: August 19 2008 8:25pm Subject: RE: ...Already a data reader associated... List-Archive: http://lists.mysql.com/dotnet/1301 Message-Id: <000601c90228$e6ae4da0$b40ae8e0$@jorge@decimal.pt> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Jesse, This has been fixed in 1.0.8 version in the 1x series: Bug #7248 There is already an open DataReader associated with this Connection which must (you can see this on the changes file) You're using version 1x right? > -----Original Message----- > From: Jesse [mailto:jc@stripped] > Sent: ter=E7a-feira, 19 de Agosto de 2008 18:53 > To: MySQL . Net List > Subject: ...Already a data reader associated... >=20 > I'm getting the error, "There is already an open DataReader associated > with > this Connection which must be closed first." when I close a = DataReader. > Here's the code: >=20 > Cmd =3D New MySQLCommand("SELECT AddPayment(" & _ > "'" & MySQLDateTime(Now) & "'," & _ > "'" & MySQLDateTime(Now) & "'," & _ > "'" & Replace(CardType.SelectedValue,"'","''") & "'," & _ > "'" & InvNo.Text & "'," & _ > "''," & _ > cTotal & "," & _ > "'') As PayID",Conn) > RS=3DCmd.ExecuteReader() > if RS.Read then > cPID =3D RS("PayID").ToString > end if > RS.Close // ERROR OCCURS HERE > RS=3DNothing >=20 > AddPayment() us a function: >=20 > CREATE DEFINER =3D 'root'@'localhost' FUNCTION `AddPayment`(dPayDate > DATETIME, > dDepositDate DATETIME, cPayType varchar(20), cInvNo varchar(7), > cCheckNo > varchar(20), nAmount double(10,2), cNotes TEXT) > RETURNS int(11) > DETERMINISTIC > CONTAINS SQL > SQL SECURITY DEFINER > COMMENT '' > BEGIN > INSERT INTO Payments > (PayDate,DepositDate,PayType,InvNo,CheckNo,Amount,Notes) VALUES > (dPayDate, dDepositDate, cPayType, cInvNo, cCheckNo, nAmount, > cNotes); > RETURN LAST_INSERT_ID(); > END; >=20 > If this were truely a "..already has a datareader associated.." error, > then > it would occur on the "Cmd.ExecuteReader()" line, not the RS.Close > line, so > I believe that this error doesn't really mean what it says. >=20 > Does anyone have any clues on this? >=20 > Thanks, > Jesse >=20 >=20 > -- > MySQL on .NET Mailing List > For list archives: http://lists.mysql.com/dotnet > To unsubscribe: > http://lists.mysql.com/dotnet?unsub=3Dmysql.jorge@stripped