IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Ah, Microsoft...
https://docs.microsoft.com/en-us/dotnet/api/system.data.odbc.odbcconnection?view=netframework-4.7.2
You should always explicitly close any open OdbcConnection objects by calling Close or Dispose before the OdbcConnection object goes out of scope, or by placing the connection within a Using statement.

So the Using construct on the connection object takes care of the close call when it goes out of scope.

But
https://docs.microsoft.com/en-us/dotnet/api/system.data.odbc.odbcdatareader.close?view=netframework-4.7.2#System_Data_Odbc_OdbcDataReader_Close
You must explicitly call the Close method when you are finished using the OdbcDataReader to use the associated OdbcConnection for any other purpose.

So I guess, closing the connection falls under "using it for any other purpose" :-/
New I was going to ask what the documentation said.
The inconsistency of closing the reader but leaving the scoped construct close the connection seems very Microsoft-ish to me.

Wade
     Doing some Winders development again. - (mmoffitt) - (5)
         Should be both or neither - (drook) - (2)
             Thanks. Another "mark the calendar day" - we're on the same page. ;0) -NT - (mmoffitt) - (1)
                 Of course we are, this time you're right :-P -NT - (drook)
         Ah, Microsoft... - (scoenye) - (1)
             I was going to ask what the documentation said. - (static)

If it nae be Scottish, it be CRRRRRRAP!
64 ms