Daily Tips- Tip #3 - Automatically closing a connection after datareader finishes execution

Tuesday, June 30, 2009





To automatically close a connection after datareader finishes execution, you need to specify the CommandBehaviour.CloseConnection parameter to the command object, as


drEmployees = cmdEmployees.ExecuteReader(CommandBehaviour.CloseConnection);



0 comments

Post a Comment

LinkWithin

Blog Widget by LinkWithin

Recommended Books