ASP.NET join子句中某个表达式的类型不正确。调用“加入”时类型推断失败

时间:2013-11-19 07:03:50

标签: asp.net

我目前正在使用LINQ从DatabaseContext实例获取数据。

using (var dbContext = new DataContext("Data Source=localhost;Initial Catalog=BillingApp;Integrated Security=True;"))
                {
                    Table<ServiceContract> service_contracts = dbContext.GetTable<ServiceContract>();
                    Table<Corporation> corporations = dbContext.GetTable<Corporation>();
                    IEnumerable<ServiceContract> tmp = from sc in service_contracts
                                                       join corp in corporations on sc.corp_id equals corp.corporation_id
                                                       select sc.corp_id;
                }

然而,系统在单词 - join下显示红线。信息如下:

The type of one of the expressions in the join clause is incorrect.  Type inference failed in the call to 'Join'

0 个答案:

没有答案