日期:2014-05-17 浏览次数:20470 次
DataTable dt2 = new DataTable();
dt2 = usbme.getNtUserDocumentSum(this.autype.SelectedValue, documentIndexValue, start, end);
StringCollection sc = new StringCollection();
for (int i = 0; i < dt2.Rows.Count; i++)
{
string user_name = dt2.Rows[i]["user_name"].ToString();
if (!sc.Contains(user_name))
{
sc.Add(user_name);
}
}
DataTable resultDt = new DataTable();
resultDt.Columns.Add("user_name", typeof(string));
resultDt.Columns.Add("documentSum", typeof(string));
//组成新的datatble
foreach (string tempStr in sc)
{
//rainwang 66 ausz2
string[] tempArray = new string[2];
tempArray[0] = tempStr;
tempArray[1] = dt2.Compute("count(documentSum)", "user_name='" + tempStr + "'").ToString();
DataRow newRow = resultDt.NewRow();
resultDt.Rows.Add(tempArray);
}
return resultDt;