未能为源类型 找到查询模式的实现 找不到select
private void button2_Click(object sender, EventArgs e)
{
tb_apply app=GetLinq();
//
var apply = from ap in app select new { ap.seq,ap.date };
}
刚开始学这个Linq。后面这句在app这个对象报错:未能为源类型 The.Linq.tb_apply找到查询模式的实现 找不到select
这是何故? 支个招吧,亲。。。。。。。
[解决办法]
提供思路,试试这个……
var vs = from u in app.AsEnumerable()
select new
{
seq = u.Field<string>("SEQ"),
date = u.Field<DateTime>("DATE") == null ? "" : u.Field<DateTime>("DATE").ToString()
};