I'm looking into access violations we get when disposing commands and noticed that in SQLiteDataReader's Close() method it closes the connection before it closes the command.
// If the datareader's behavior includes closing the connection, then do so here.
if ((_commandBehavior & CommandBehavior.CloseConnection) != 0 && _command.Connection != null)
_command.Connection.Close();
if (_disposeCommand)
_command.Dispose();
shouldn't that be the other way around? Close the command first?
SQLiteConnection cnn = _command.Connection;
if (_disposeCommand)
_command.Dispose();
// If the datareader's behavior includes closing the connection, then do so here.
if ((_commandBehavior & CommandBehavior.CloseConnection) != 0 && cnn != null)
cnn.Close();
Thanks,
Sam
We're hiring! B-Line Medical is seeking .NET Developers for exciting positions in medical product development in MD/DC. Work with a variety of technologies in a relaxed team environment. See ads on http://careerbuilder.com.