【发布时间】:2014-04-30 08:04:56
【问题描述】:
我正在尝试在 Visual Studio 2008 中使用 EDMX 编写一个简单的保存和加载操作。
这是我的加载方法:
public static DataTable LoadData()
{
using (testEntities context = new testEntities())
{
testEntities temp = new testEntities();
DataTable dt = new DataTable();
IQueryable<DataRow> empResults = (from c in temp.emplyee
select c).AsQueryable();
}
return dt;
}
但是我收到以下错误:
无法将类型“System.Linq.IQueryable”隐式转换为 'System.Linq.IQueryable'。显式转换 存在(您是否缺少演员表?)
我找不到此转换的任何确切链接。
【问题讨论】:
-
temp.emplyee的类型是什么? -
如果您使用的是 Linq-to-Entities,顺便说一下,您不需要
DataTable或SqlDataAdapter。 -
我更新了我的问题
标签: asp.net entity-framework visual-studio