What is the use/advantage of using CommandBehavior.CloseConnection in ExecuteReader()

后端 未结 6 1959
甜味超标
甜味超标 2020-12-14 09:38

Can anyone tell me what is the CommandBehavior.CloseConnection and what is the use/benefit of passing this as a parameter in com.ExecuteReader(CommandBeha

6条回答
  •  春和景丽
    2020-12-14 10:02

    I suggest reading through the MSDN documentation for the CommandBehaviour Enumeration:

    CloseConnection - When the command is executed, the associated Connection object is closed when the associated DataReader object is closed.

    Compare this against the other enumeration items.

提交回复
热议问题