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

Note: Only a member of this blog may post a comment.

Blog Widget by LinkWithin