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);
Subscribe to:
Post Comments (Atom)
0 comments
Post a Comment