简体   繁体   中英

entity framework error in .net

I am trying make a join in entity framework and display datas in a label but i get an error like "FileLoadException was unhandled by user code".Here is my codebehind:

protected void display() {

         AspNetOrnekEntities entity = new AspNetOrnekEntities();
         var everything = (from insan in entity.insanlar
                           join renk in entity.renkler on insan.SevdigiRenk equals renk.Renk
                           select new
                           {

                               kisiId = insan.KisiId,
                               renkId = renk.RenkId

                           });

         foreach (var data in everything)
         {
             Label1.Text += data.kisiId + "   " + data.renkId + "<br/>";
         }
    }

I call "display" in page_load and error comes from that line. I think problem occurs because of first line of the display method because I turned all other lines into comments and problem still occurs. I am using Model1.edmx as connection.

使用软件包管理器控制台更新EF

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM