索引超出范围
for (int i = 0; i < GridView1.Rows.Count; i++)
{
for (int j = 0; j < GridView1.HeaderRow.Cells.Count; j++)
{
double endscore = 0;
double ss = 0;
string Coln = GridView1.Columns[j].HeaderText.ToString();
DataTable dt1 = total.GetTotalGrade(Coln);
double credit = Convert.ToDouble(dt1.Rows[0]["credit"].ToString().Trim());
endscore = ss + Convert.ToDouble(GridView1.Rows[i].Cells[j].Text.Trim()) / credit;
string End = Convert.ToString(endscore);
GridView1.Rows[i].Cells[2].Text = End;
}
}