Re: There is already an open DataReader associated with this Connection which must be closed first, AGAIN !!!!!!

From: William Ryan eMVP (bill_at_NoSp4m.devbuzz.com)
Date: 02/10/04


Date: Tue, 10 Feb 2004 01:53:44 -0500

Either close the first connection or, if you must keep it open b/c you are
firing another reader from within it and you can't use another data
structure, use a second connection.
"ItsMe" <kkk@yahoo.com> wrote in message
news:uKrBc957DHA.2812@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I know, i'm repeating this question again. Please accept my apologize,
> unable to understand clearly. Need to have some inputs in my routine. I'VE
A
> DEADLINE AND I'M STUCK !!!!! :(
>
> I'm retrieving Data from Paradox database using (odbc), manipulating and
> saving in access for report generation.
>
> I'm trying to put what i'm doing simple pseudocode:
> ==================================
>
> - Write SQL Statement and Retrieve Data from Paradox Tables using
> DataAdapterParadox (OdbcConnection)
> - Loop through the records till end-of-file
> - Manipulate Data
> - Writing SQL Statement to get some values from another table
of
> same paradox database
> - Insert retrieved values from two sql statement into Access Table
> - Close connection
>
> My vb.net code:
> ===========
> sSQL = "SELECT C.BRANDCODE, SUM(B.QTY) AS QTY" & _
> " FROM SALESINFO A, DOMODELINFO B, PRODUCTINFO C" & _
> " WHERE A.INVNO = B.INVNO AND A.YEAR = " &
> CInt(cmbTotalSalesYear.Text) & _
> " AND B.MODEL = C.MODEL" & _
> " GROUP BY C.BRANDCODE ORDER BY C.BRANDCODE"
> oDataReaderPdx = mDBReaderPdx(sSQL)
> With oDataReaderPdx
> If .HasRows Then
> While .Read
>
> ' Here i want to write another sql statement,
match
> brandcode with another tables and get the total amount for that.
> ' If I use another datareader, it says "There is
> already an open DataReader associated with this Connection which must be
> closed first"
> ' How do i solve this issue ?
>
> Dim iTotalJan As Int32
> sSQL = "INSERT INTO tblYearlyReport (ReportType,
> ComputerName, " & _
> " FirstField, Qty)" & _
> " VALUES (" & mQuotedStr("TOTALSALES") &
","
> & _
> mQuotedStr(mGetComputerName()) & "," & _
> mQuotedStr(.GetValue(0)) & "," & _
> .GetValue(1) & ")"
> mExecCmdAccess(sSQL)
> End While
> End If
> .Close()
> End With
>
>
> I hope you guyz understood my problem. Please Help !!!!
>
> Thanks in Advance.
>
>



Relevant Pages

  • Re: First Connection Open Slow from ASP.Net
    ... I created a simple windows form app that just opens the ... connection and then closes it, same as what I stripped the ... causing this delayed first connection opening. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Init before anything else
    ... The system starts and is idle until some one calls ... as soon as first Connection is received and only on first ... > connection request Init() has to be called before serving Connection ...
    (comp.lang.c)
  • Re: First Connection Open Slow from ASP.Net
    ... The speed of next connections is a feature of connection pooling I think. ... Why the first connection is slow, ... > Connection string options, autentication mode, IP vs. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection String/Network Library
    ... There were two connection objects on ... opening of the first connection object. ... The page didn't need two connection objects to the same database anyway, ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)
  • Paradox Database Connection
    ... I'm an amateur programmer and I have been using Delphi but want to start ... I need to connect to some existing Paradox database tables but I'm not ... If I try and create a data server using OLEDB, I get a error message saying ... "Could not find installable ISAM" when I try and test the connection. ...
    (microsoft.public.dotnet.languages.csharp)

Loading