首页新闻找找看学习计划

Cannot set MySqlCommand.CommandText when there is an open DataReader for this command; it must be closed first.

0
[已解决问题] 解决于 2019-07-24 09:11

System.InvalidOperationException
Cannot set MySqlCommand.CommandText when there is an open DataReader for this command; it must be closed first.

System.InvalidOperationException: Cannot set MySqlCommand.CommandText when there is an open DataReader for this command; it must be closed first.
at MySql.Data.MySqlClient.MySqlCommand.set_CommandText(String value) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlCommand.cs:line 201
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.CreateCommand(IRelationalConnection connection, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary2 parameterValues, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.AsyncQueryMethodProvider.FastQueryAsyncEnumerable1.FastQueryAsyncEnumerator.MoveNext(CancellationToken cancellationToken) at System.Linq.AsyncEnumerable.Aggregate_[TSource,TAccumulate,TResult](IAsyncEnumerable1 source, TAccumulate seed, Func3 accumulator, Func2 resultSelector, CancellationToken cancellationToken) in D:\a\1\s\Ix.NET\Source\System.Interactive.Async\Aggregate.cs:line 120
at dotNET.Application.App.AreaListApp.TestAsync() in C:\Users\conanl\source\repos\conan.net\src\Application\Sys\AreaListApp.cs:line 20
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

conan_lin的主页 conan_lin | 初学一级 | 园豆:4
提问于:2019-07-08 11:44
< >
分享
最佳答案
0

ioc 注入问题

conan_lin | 初学一级 |园豆:4 | 2019-07-24 09:11

能给点提示吗?

灬丶 | 园豆:64 (初学一级) | 2019-09-18 10:13
其他回答(2)
0

多少贴点代码出来噻,比如从DataReader 取出数据的那段代码

~冰 | 园豆:497 (菜鸟二级) | 2019-07-08 14:36
0

你解决了吗?我看你说是ioc注入问题?

灬丶 | 园豆:64 (初学一级) | 2019-09-18 10:13
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册