I have two data tables as following
TableA TableB UID QID QID Value1 Value2
I want to join two data tables and get Value1 and Value 2. I tried the following, but I am not getting any data back.
string str = "AAA"; var result = (from t1 in TableA.AsEnumerable() //join between two tables join t2 in TableB.AsEnumerable() on t1.Field
("UID") equals t2.Field ("QID") //where conditions where t2.Field ("QID") == str && t1.Field ("QID") == "ABCD" //select clause select t2.Field ("Value1"));
This is my query with out using LINQ and its working.
Select t2.Value1, t2.value2 from TableA t1 JOIN TableB t2 ON t2.QID = t1.UID WHERE t2.QID = 'AAAAA' AND t1.QID = 'XXXX'
Thanks for your help.