2010-06-14 4 views
0

안녕하세요 linq에서 하위 쿼리를 수행하려고하는데 하위 쿼리가 값이고 작동하지 않는 것처럼 보입니다. 아무도 도와 줄 수 있습니까? 이유는 모르겠지만 문자열 오류가 계속 발생하는 intit 프레임 작업을 사용하고 있습니다.subqueries linq

from lrp in remit.log_record_product 
           join lr in remit.log_record on lrp.log_record_id equals lr.log_record_id 
           where (lrp.que_submit_date >= RadDatePickerStartDate.SelectedDate) && (lrp.que_submit_date <= RadDatePickerEndDate.SelectedDate) 
           select new { lrp.que_submit_date, 
            lr.officer_name, 
            lr.c_fname, 
            lr.c_lname, 
            lrp.price_sold, 
            lrp.product_cost, 
            gap_account_number = (from gap in remit.gap_contracts where gap.log_record_product_id == lrp.log_record_product_id select gap.account_number), 
            iui_account_number = (from iui in remit.iui_contracts where iui.log_record_product_id == lrp.log_record_product_id select iui.account_number), 
            dp_account_number = (from dp in remit.dp_contracts where dp.log_record_product_id == lrp.log_record_product_id select dp.account_number), 
            mpd_account_number = (from mpd in remit.mbp_contracts where mpd.log_record_product_id == lrp.log_record_product_id select mpd.product_account_number) 
           } 
+0

사용하는 반환? – Vishal

답변

2

각 하위 쿼리는 Enumerable<Type>

시도가 (from c in collection).First()를 사용하거나 exctly하고있는 부분에 대해 점점 어떤 오류 (from c in collection).FirstOrDefault()

+1

또는'.Single()', 두 개의 계정에 동일한 'log_record_product_id'가 없으면 –