mysqldatareader

SubSonic: MySqlDataReader closes connection.

I am using SubSonic 2.1 and entcountered a problem while executing a Transaction with SharedDbConnectionScope and TransactionScope. The problem is that in the obj.Save() method I get an "The connection must be valid and open" exception I tracked down the problem to this line: // Loads a SubSonic ActiveRecord object User user = new Use...

.NET MySql does "Using" closes the datareader?

I used to close an open datareader using the try/catch/finally block: Dim dr As MySqlDataReader = Nothing Try dr = DBConnection.callReadingStoredProcedure("my_sp") Catch ex As Exception ' the caller will handle this Throw ex Finally If dr IsNot Nothing Then dr.Close() End Try But I think it should be cleaner (and som...

Optimization of SQL Select for enumerators

How can this query be optimized for enumerators: SELECT * FROM Customers Table Customers customerId int - has index on it customerName, etc SqlReader that returns a set customers will be read on-demand in an enumerator fashion. While it can return huge datasets that can be read/consumed slowly in a foreach loop, every other query on ...