What is the use of CommandBehavior.CloseConnection?

 Posted by Raja on 5/5/2008 | Category: C# Interview questions | Views: 15089

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.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response