Monday, April 10, 2006

Like Cats and Dogs, Oracle and .NET

All they want to do is fight and disagree. Anyways, Friday turned out to be a royal head-banging session as I tried to figure out why the heck I received an InvalidOperationException every time I tried accessing the members of an OracleDataReader filled from a stored proc. I'm using .NET 2.0 (simple console app for testing), the new ODP.NET beta (the only one that likes ADO.NET 2.0 aparently), a 10g XE install on my machine, and a stored proc. package using out Ref Cursors.

The execution seems to work fine (the data reader actually says it has rows in it) until I try and retrieve any data. Once I access a data member in any way (Get Methods, GetOracle Methods, and Indexes) I receive an "InvalidOperationException: Operation is not valid due to the current state of the object." This is driving me nuts. I've tried to peel back all the object layers I can, but to no avail. I can't seem to find exactly where the problem is.

Now originally I had been using the DAAB (Enterprise Library Data Access Application Block) with the same results, but as per usual I've stripped it down to a single executable running the most basic operation. All simply frustrating.

Anyways, if you happen to have any ideas I'm all ears, otherwise I'm off to the Oracle forums ::shudder:: to see if someone will help.

No comments: