Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains() operator

后端 未结 4 582
夕颜
夕颜 2020-11-29 08:29

I am using LINQ in my project and my code is:

var SE = from c in Shop.Sections
                    join c1 in obj.SectionObjects on c.SectionId equals c1.Sec         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 08:54

    var SE = from c in Shop.Sections.AsEnumerable().ToList() join c1 in obj.SectionObjects.AsEnumerable().ToList() on c.SectionId equals c1.SectionId select c;

    dataGridView1.DataSource = SE;

提交回复
热议问题