62,254
社区成员
发帖
与我相关
我的任务
分享
int total=0;
for(int i=1;i<this.gridview2.Rows.count;i++)
{
if(gridview2.Rows[i].Cells[2].text!="")
{
total+=Convert.ToInt16(gridview2.Rows[i].Cells[2].text.tostring());
}
}
if (ds2.Tables[0].Rows.Count > 0)
{
int total = 0;
for (int i = 0; i < ds2.Tables[0].Rows.Count; i++)
{
if (ds2.Tables[0].Rows[i]["plan_package"].ToString() != "")
{
total += Convert.ToInt16(ds2.Tables[0].Rows[i]["plan_package"].ToString());
}
}
this.Label5.Text = "本票共计 " + total.ToString() + " 件";
} float a = 0;
DataTable dt=GridView1.DataSource;
for (int i = 0; i < dt.Rows.Count; i++)
{
a +=Convert.ToSingle(dt.Rows[i[4].Text);
}