What is the syntax for an inner join in LINQ to SQL?

后端 未结 19 1875
感情败类
感情败类 2020-11-22 04:25

I\'m writing a LINQ to SQL statement, and I\'m after the standard syntax for a normal inner join with an ON clause in C#.

How do you represent the follo

19条回答
  •  没有蜡笔的小新
    2020-11-22 04:55

    One Best example

    Table Names : TBL_Emp and TBL_Dep

    var result = from emp in TBL_Emp join dep in TBL_Dep on emp.id=dep.id
    select new
    {
     emp.Name;
     emp.Address
     dep.Department_Name
    }
    
    
    foreach(char item in result)
     { // to do}
    

提交回复
热议问题