I'm creating a .net db provider and I came across a weird problem w/ my data
reader.
The .net provider was created in managed c++ becuase the db api is also c++.
I'm calling the code from a c# project. It shouldn't make a difference but I
did have to do
http://support.microsoft.com/default.aspx?scid=kb;[LN];814472&product=vcNET
to get my c++ project to compile properly. Anyways, as test i did 'select *
from items' using both an ole db dataadapter and my custom db provider, but
targeting the same database. The items table has about 220 fields and 3,222
records. The oledb adapter filled a dataset with no problem. My data adapter
bombed out when retrieving field 10 of record 563.
The problem occurs in my custom data adpater which is used by the customer
data adapter. Everytime MyCustomDataReader.Read() is called, (in this case)
it initializes an Array of type Object with a length of 220. It then does a
foreach and fills in each cell with the data stored in the record.
Now here's where it gets funky. If I call GC.Collect and/or
System.Windows.Forms.Application.DoEvents() w/ each iteration, it will
retrieve all the records w/ no problems. Doing neither causes the
application to exit and no exception is thrown either. The debug output
shows the exit code as 0. Does anyone have any clues as to why?
The fact that it doesn't throw an exeption is what bothers me the most.