Re: Microsoft .Net Provider does not return all Rows
From: William Ryan eMVP (dotnetguru_at_comcast.nospam.net)
Date: 02/10/04
- Next message: William Ryan eMVP: "Re: ?At a loss? ExecuteNonQuery executing my Insert Statement 3 times in debug mode"
- Previous message: lover: "The custom tool 'MSDataSetGenerator' failed while processing the file..."
- In reply to: DelC: "Microsoft .Net Provider does not return all Rows"
- Next in thread: DelC: "Re: Microsoft .Net Provider does not return all Rows"
- Reply: DelC: "Re: Microsoft .Net Provider does not return all Rows"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 10 Feb 2004 17:05:32 -0500
DelC:
I've used this provider extensively and haven't noticed this problem. Just
to test a few things...use the same query but use a DataAdapter to fill a
datatable and verify DataTable.Rows.Count. I expect the number will match
SQL+ if the query is the same. Next, take out all the code in your While
dr.Read loop and just debug.writeline (i) and then i++. I expect it will
be the same here too. I'm not sure what Limit is, but since you don't know
what the rowcount of a reader is without walking through it (or sending a
Count(*) query with the exact same where clause prior to executing your
reader and assuming the row count hasn't changed in the interim)..it's quite
likely that you are knocking yourself out of the loop with the Exit While
like Miha pointed out.
I can't say for sure that the Oracle provider is bug free, but I've used it
a ton and never seen this, and if it were a bug this serious, I think
there'd be a lot more talk of it.
HTH,
Bill
"DelC" <anonymous@discussions.microsoft.com> wrote in message
news:2D918E18-787D-4962-8F6A-13547C499E39@microsoft.com...
> We are experiencing a problem in using the Microsoft .Net Data Provider
For
> Oracle. For certain more complex SQL queries it does not return the
correct
> number of rows. The behaviour can take two forms
> 1 the DataReader returns no rows back to the calling program, on the
> database one fetch has been done and a fraction of the expected rows has
> been processed.
> 2 The reader returns rows but the amount of rows is less than total
returned
> if the SQL is run directly, on the database a number of fetches have been
> done.
>
> In both cases the SQL is valid and can be executed from SQL+, so I am
happy
> that there is not a problem with the data itself or the database.
>
> We tried this provider as we wanted to stay with the Oracle 8.1.7 client.
We
> are currently deploying on .Net 1.0 Framework using MDAC 2.7.
>
> Has anyone else had any problems with this data provider ?
>
> Example SQL that does work
>
> SELECT B.F01_143,A.F00_025,A.F00_026 FROM SEG_01 B, SEG_00 A WHERE
A.F00_002
> = B.F01_145
>
> Example SQL that doesn't work
>
> SELECT B.F01_143,A.F00_025,A.F00_026 FROM SEG_01 B, SEG_00 A WHERE
A.F00_002
> = B.F01_145 AND ( ( 1 = ( SELECT COUNT( F00_030 ) FROM SEG_01 B1, SEG_00
A1
> WHERE A1.F00_002 = B1.F01_145 AND B1.F01_003 = B.F01_003 GROUP BY
> B1.F01_003) ) )
>
> Example Code showing basic connection objects
>
> Imports SDO = system.Data.OracleClient
>
> mConnection = New SDO.OracleConnection(mConnectionString)
> mySQL = TextBox1.Text
>
> mConnection.Open()
>
> mCommand = New SDO.OracleCommand(mySQL, mConnection)
> mCommand.CommandType = CommandType.Text
>
> Dim startTime As Date = Now
> aRdr = mCommand.ExecuteReader()
> While aRdr.Read
> PrintLine(theFile, aRdr.Item(0).ToString)
> linecount += 1
> If linecount > limit Then
> Exit While
> End If
> End While
> aRdr.Close()
> Dim stopTime As Date = Now
> Label2.Text = Now.ToLocalTime + " It took " +
> CStr(DifferenceInSeconds) + " seconds and returned " + CStr(linecount) +
> "rows"
>
> mConnection.Close()
>
- Next message: William Ryan eMVP: "Re: ?At a loss? ExecuteNonQuery executing my Insert Statement 3 times in debug mode"
- Previous message: lover: "The custom tool 'MSDataSetGenerator' failed while processing the file..."
- In reply to: DelC: "Microsoft .Net Provider does not return all Rows"
- Next in thread: DelC: "Re: Microsoft .Net Provider does not return all Rows"
- Reply: DelC: "Re: Microsoft .Net Provider does not return all Rows"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|