首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

未能为流类型 找到查询模式的实现 找不到select

2012-12-31 
未能为源类型 找到查询模式的实现 找不到selectprivate void button2_Click(object sender, EventArgs e){

未能为源类型 找到查询模式的实现 找不到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()
                     };

热点排行