日期:2014-05-17 浏览次数:20463 次
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
TextBox1.Text = ds.Tables[0].Compute("sum(UserNum)", "UserRole = '" + ds.Tables[0].Rows[i]["UserNum"] + "'").ToString();
}
int sum = 0;
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
sum += Convert.ToInt32(ds.Tables[0].Rows[i]["求和字段"].ToString());
}
TextBox1.Text = sum.ToString();