I have come across a quirky "feature" in Visual Studio and I was interested in seeing if anyone else had noticed this. Or if it is specific to myself.
I have some methods that perform SQL queries on a database and then return an OracleDataReader
method()
{
OracleCommand cmd = new command(query, connection);
OracleDataReader r = cmd.ExecuteReader();
return r;
}
When I am debugging the code that uses this method. I can click on the non public members to view the rows in the results. However once I have viewed these results trying to perform a reader.Read() on the OracleDataReader does not contain any results. Checking the results in the debugger view shows the reader as Empty.
Any time I do not check the results, the code that executes Read works without any problems.
I've not found evidence of this via Google, but my search skills often leave a lot to be desired. If anyone could confirm this on a system of their own or shed some light on the causes I would greatly appreciate it.
Thanks very much.