From: Date: August 19 2008 7:52pm Subject: ...Already a data reader associated... List-Archive: http://lists.mysql.com/dotnet/1300 Message-Id: <000701c90224$674e1b20$6901a8c0@ANCHORMAN> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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: Cmd = New MySQLCommand("SELECT AddPayment(" & _ "'" & MySQLDateTime(Now) & "'," & _ "'" & MySQLDateTime(Now) & "'," & _ "'" & Replace(CardType.SelectedValue,"'","''") & "'," & _ "'" & InvNo.Text & "'," & _ "''," & _ cTotal & "," & _ "'') As PayID",Conn) RS=Cmd.ExecuteReader() if RS.Read then cPID = RS("PayID").ToString end if RS.Close // ERROR OCCURS HERE RS=Nothing AddPayment() us a function: CREATE DEFINER = '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; 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. Does anyone have any clues on this? Thanks, Jesse