SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);//关闭SqlDataReader 会自动关闭Sqlconnection
转载于:https://www.cnblogs.com/shenbing/p/5810153.html
本文讨论了在使用SqlDataReader时如何自动关闭SqlConnection。当使用CommandBehavior.CloseConnection参数时,读取器关闭后会自动关闭连接。
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);//关闭SqlDataReader 会自动关闭Sqlconnection
转载于:https://www.cnblogs.com/shenbing/p/5810153.html
366

被折叠的 条评论
为什么被折叠?