在这里,我想找到两个数据表中的匹配记录.代码是
public DataTable textfiltering(DataTable dtfff, DataTable dtff)
{
DataTable ds = (DataTable)Session["maintxt"];
DataTable dts = (DataTable)Session["sectxt"];
dtfff = ds;
dtff = dts;
DataTable dtMerged = (from a in dtfff.AsEnumerable()
join b in dtff.AsEnumerable()
on a["contacts"].ToString() equals b["contacts"].ToString()
into g
where g.Count()>0
select a).CopyToDataTable();
return dtMerged;
}
Run Code Online (Sandbox Code Playgroud)
当数据表不包含匹配记录时,它给出"源不包含数据行"...如何纠正它...请给出你的建议