When using Query Syntax in C# "Enumeration yielded no results". How to retrieve output
- by Shantanu Gupta
I have created this query to fetch some result from database.
Here is my table structure.
What exaclty is happening.
DtMapGuestDepartment as Table 1
DtDepartment as Table 2
Are being used
var dept_list= from map in DtMapGuestDepartment.AsEnumerable()
where map.Field<Nullable<long>>("GUEST_ID") == DRowGuestPI.Field<Nullable<long>>("PK_GUEST_ID")
join
dept in DtDepartment.AsEnumerable()
on map.Field<Nullable<long>>("DEPARTMENT_ID") equals dept.Field<Nullable<long>>("DEPARTMENT_ID")
select dept.Field<string>("DEPARTMENT_ID");
I am performing this query on
DataTables and expect it to return me
a datatable.
Here I want to select distinct department from Table 1 as well which will be my next quest. Please answer to that also if possible.