C# 源数组长度不足。请检查 srcIndex 和长度以及数组的下限。
string strConn = "Data Source=127.0.0.1;Initial Catalog=zy;User ID=sa;Password=229107my229107m";
SqlConnection ConnAcc = new SqlConnection(strConn);
string strSQL = "SELECT * FROM Group_SGK3 ";
SqlDataAdapter de = new SqlDataAdapter(strSQL, ConnMdb);
try
{
//da.Fill(dt);
dtData.Clear();
de.Fill(dtData);
}
catch
{
break;
}
for (int n = 0; n < 7; n++)
{
int GK;
foreach (DataRow rdr in dtData.Rows)
{
int SGK = Convert.ToInt32(rdr["SGK"]);
&