已经关联了一个开放的DataReader
问题描述:
这是错误:-
{已经有与此命令相关联的打开的DataReader,必须先关闭它."}
This is the error:-
{"There is already an open DataReader associated with this Command which must be closed first."}
答
如果没有看到代码,将很难查明罪魁祸首.但是,在 ^ ]给出了96,700个结果.我相信这足以解决您的问题.
Without seeing the code, it would be hard to pinpoint the culprit. However, typing the error on Google[^] gave out 96,700 results. I believe that is enough for you to troubleshoot it.
就在您使用SqlDataReader之前:
just before you use the SqlDataReader:
if (!SqlDataReader.IsClosed)
SqlDataReader.Close();
SqlDataReader :将您声明的SqlDataReader的名称放在此处.
SqlDataReader: put here the name of your declared SqlDataReader.