我正在使用以下查询
foreach (var callDetailsForNode_ReArrange in callDetailsForNodes_ReArrange)
{
var test = from r1 in dtRowForNode.AsEnumerable()
join r2 in dtFileRowForNode.AsEnumerable()
on r1.Field<int>("Lng_Upload_Id") equals r2.Field<int>("Lng_Upload_Id")
where ((r1.Field<string>("Txt_Called_Number") == callDetailsForNode_ReArrange.caller2.ToString()) || r1.Field<string>("Txt_Calling_Number") == callDetailsForNode_ReArrange.caller2.ToString())
select r2.Field<string>("Txt_File_Name");
var d = test.Distinct();
}
到这里为止,这个查询很快就会运行。但正如我添加的
string[] str =d.ToArray();
strFileName = string.Join(",", str);
运行大约需要 4-5 秒。是什么让它添加这么慢.ToArray()
?