Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Npgsql实体框架错误57014_C#_Entity Framework_Postgresql - Fatal编程技术网

C# Npgsql实体框架错误57014

C# Npgsql实体框架错误57014,c#,entity-framework,postgresql,C#,Entity Framework,Postgresql,我使用以下代码访问数据库表: DbConnection dbConnection = new NpgsqlConnection("PORT=5432;TIMEOUT=15;POOLING=True;MINPOOLSIZE=1;MAXPOOLSIZE=20;COMMANDTIMEOUT=20;COMPATIBLE=2.2.4.3;HOST=localhost;DATABASE=postgres;USER ID=yep;PASSWORD=thisisnottherealone;-)"); DB

我使用以下代码访问数据库表:

 DbConnection dbConnection = new NpgsqlConnection("PORT=5432;TIMEOUT=15;POOLING=True;MINPOOLSIZE=1;MAXPOOLSIZE=20;COMMANDTIMEOUT=20;COMPATIBLE=2.2.4.3;HOST=localhost;DATABASE=postgres;USER ID=yep;PASSWORD=thisisnottherealone;-)");

 DB = new DataAccessContext(dbConnection);
 IQueryable<Customer> customers = from c in DB.Customers
                        select c;
 List<Customer> test =  customers.ToList();
 ...
问题是有一条错误消息:NpgsqlException-error:57014

查询本身花费了令人恼火的很长时间

大多数情况下,对象似乎是由EF创建的

有没有可能加快速度,不出现异常?它不是获取数据子集的替代方法


是否有EF缓存之类的可配置项?

错误57014查询被取消。这意味着您的查询已被取消。问题是为什么?Customers表中有多少条记录?@jansalawa O,我忘记了一些细节:NPGSQL 2.2.5,EF6,21513行。如果我在DB select Extent1.RowId上使用相同的select语句。。。来自public.Customers作为Extent1,由EF内部NpgsqlException触发,它是{FEHLER:57014:storniere Anfrage wegen Zeitüberschreitung der Anfrage}->意思是:由于超时而停止,数据需要从pgadmin3发送2006毫秒。因此,我的问题更多:我如何告诉EF执行查询,然后转换顶级对象,而不是像执行和非常缓慢的转换那样?