执行SqlDataReader.Read之后,如果还想用另一个SqlCommand执行Insert或者Update操作的话,会得到一个错误提示:There is already an open DataReader associated with this Command which must be closed first.
解决方法是在ConnectionString中加上一个参数“MultipleActiveResultSets”, 将其值设置为true。
执行SqlDataReader.Read之后,如果还想用另一个SqlCommand执行Insert或者Update操作的话,会得到一个错误提示:There is already an open DataReader associated with this Command which must be closed first.
解决方法是在ConnectionString中加上一个参数“MultipleActiveResultSets”, 将其值设置为true。