Multiple Table Join in Linq C# Dynamically

Posted by kmkperumal on Stack Overflow See other posts from Stack Overflow or by kmkperumal
Published on 2012-12-17T17:00:37Z Indexed on 2012/12/17 17:03 UTC
Read the original article Hit count: 270

Filed under:
|

I have 3 data table a,b,c In this I need to write Join Query Dynamically using linQ. The Selecting columns given by customer and Condition columns also given customer at run time. So i need to create Querys dynamically.Please check below example.Because i dont which table they want and which column also For example

  1. Select a.c1,a.c2,b.c1,b.c2 From a Left Join b on a.c1=b.c1

2.Select c.c1,c.c2,a.c1,a.c2 From c Left Join a on c.c3=a.c1

3.Select a.c1,a.c2,b.c1,b.c2,c.c1,c.c2 From a Left Join b on a.c2=b.c2 Left join c on c.c1=a.c1

Like i need create different set of query's. Please help me on this.

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ