【发布时间】:2013-07-10 09:01:52
【问题描述】:
我只是写了一个我认为非常简单的查询:
public IList<Departement> GetDepartements()
{
IQueryable<MyContext> queryBase = QueryBase();
IQueryable<Departement> query =
(from x in queryBase
group x by x.Geographies.DepartementCode
into grp
select new Departement
{
code = grp.Key,
numberOfDistributors =
grp.Select(x=> x.Distributors.Distributeur_PK)
.Count(),
numberOfLeads =
grp.Select(x=> x.Leads.DemandeWeb_FK).Count()
}
);
return query.ToList();
}
很遗憾,我收到了连接超时错误。
我不想更改 DataContext.CommandTimeout 属性,因为我觉得这样一个简单的查询没有必要。
知道为什么会出现此错误吗?
【问题讨论】:
标签: c# .net linq-to-sql connection-timeout