Tuesday, July 1, 2014

left join with linq query

DataTable mrfListItems = mrfListItemsWithFilter.CopyToDataTable();
SPListItemCollection sapItems = listSapEmpDetails.GetItems(query2);
DataTable sapListItems = sapItems.GetDataTable();


var finalResult = (from mrfItem in mrfListItems.AsEnumerable()
                           join row2 in sapListItems.AsEnumerable()
                           on Convert.ToString(mrfItem["ID"]) equals Convert.ToString(row2["Title"]) into CO
                           from sapItem in CO.DefaultIfEmpty()
                           select new
                           {
                           MRFRefNo = mrfItem["Title"],
                            EmployeeDepartment = (sapItem != null ? sapItem["EmployeeDepartment"] : string.Empty)
                           });

No comments:

Post a Comment

Image noise comparison methods

 1. using reference image technique     - peak_signal_noise_ratio (PSNR)     - SSI 2. non-reference image technique     - BRISQUE python pac...