我有一个名为foldername
,的列的数据表documentname
。数据如下:
FolderName DocumentName
Folder1 HR[D] Document
Folder1 ___----'
Folder1 Asp_example.pdf
Folder2 SD
Folder3 Heavy_weight
Folder3 Accesorial Services
如何alphabetically
在.Net Framework 2.0
.
我们尝试的解决方案如下,但由于它包含超过 1200000 条记录而花费了太多时间。
int counter=0;
while (counter < searchDT.Rows.Count){
string FolderName = Convert.ToString(searchDT.Rows[counter]["Folder Name"]);
string exp = "[Folder Name] like '" + FolderName + "'";
if (FolderName.Contains("%") || FolderName.Contains("_") || FolderName.Contains("[]") || FolderName.Contains("'"))
exp = "[Folder Name] like '" + EscapeLikeValue(FolderName) + "'";
string sortExpression = "[Document Name] ASC";
DataRow[] drfoldername = searchDT.Select(exp, sortExpression);
foreach (DataRow row in drfoldername)
drfoldernameDT.ImportRow(row);
counter += drfoldername.Length;
}