interviews.dotnetthread.com

↑ Grab this Headline Animator

Tuesday, May 13, 2008

What is the use of CommandBehavior.CloseConnection?

We can use pass it with ExecuteReader method of Command object like

reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);

This will make sure that when we are calling reader.Close() the associated connection object will also be closed.

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles