在.NET环境中使用SqlSugar等ORM框架时,如果多个线程同时尝试使用同一个数据库连接(SqlSugarClient或SqlSugarScope)执行操作,可能会遇到“There is already an open DataReader associated with this Connection which must be closed first”的错误。这个错误表明当前连接上已经有一个打开的DataReader,而新的操作需要关闭这...
当使用MySql数据库时,第二次查询时报错“There is already an open DataReader associated with this Connection which must be closed”。 1,由于MySqlConnection(数据库连接)的对象是全局变量引用,虽然可以通过关闭数据库连接清除报警,但占用资源较大。--未采用 1MySqlConnection sqlConnection =newMySqlConnection(conn...
unitOfWork调用umObj.Current.GetOrBeginTransaction(),报错There is already an open DataReader associated with this Connection which must be closed first 这个错误通常是由于一旦开始读取数据,就不能在同一连接上执行其他查询,因为DataReader已经在使用连接。在这种情况下,可以尝试解决以下几个问题: 明确使用连接。确...
1、已有打开的与此 Command 相关联的 DataReader,必须首先将它关闭。 There is already an open DataReader associated with this Connection which must be closed first. 出现这个错一般是线程安全引起的 (1)、SqlSugarClient 替换成 SqlSugarScope ,因为SqlSugarScope 是线程安全对象(用SqlSugarClient同一个DB不能跨...
There is already an open DataReader associated with this Connection which must be closed first. at SqlSugar.AdoProvider.GetDataReaderAsync(String sql, SugarParameter[] parameters) at SqlSugar.QueryableProvider`1.GetDataAsync[TResult](KeyValuePair`2 sqlObj) ...
error - There is already an open datareader associated with this connection which must be closed first James Thye November 22, 2011 01:50PM Sorry, you can't reply to this topic. It has been closed. Content reproduced on this site is the property of the respective copyright holders. It is...
There is already an open DataReader associated with this Command which must be closed first.这个是...
There is already an open DataReader associated with this Command which must be closed first?这是...
int id = model.UniqueId; string Connect = model.Link; DataTable dtbl = new DataTable(); using (SqlConnection con = new SqlConnection(connectionString2)) { con.Open(); string qry = "select * from AppMasterTable where SchoolCode='" + id + "' "; ...
1.There is already an open DataReader associated with this Connection which must be closed first 2.npm install 失败 3.WebApi HTTP Put 405 Method not allowed 问题现象:一个接口被多次调用,可以认为是多线程调用接口,接口内部使用了C#的Async Await,代码形如: ...