问题描述
inti;OleDbConnectionconn_jetj=newOleDbConnection(connstr);OleDbCommandcmd_jetj=newOleDbCommand();conn_jetj.Open();cmd_jetj.Connection=conn_jetj;progressBar1.Maximum=dt_zhlb.Rows.Count;for(i=0;i<=dt_zhlb.Rows.Count-1;i++){Application.DoEvents();dataGridView1.Rows.Add();dataGridView1[0,i].Value=(i+1).ToString();dataGridView1[1,i].Value=dt_zhlb.Rows[i]["zh"];dataGridView1[2,i].Value=dt_zhlb.Rows[i]["xm"];intj=1;DateTimetjrq=newDateTime(2007,09,01);for(j=1;j<=DateTime.DaysInMonth(tjrq.Year,tjrq.Month);j++){cmd_jetj.CommandText="SELECTSUM(jyje)ASjeFROMfkczWHERE(zh='"+dt_zhlb.Rows[i]["zh"]+"')AND(fsrq=#"+tjrq.AddDays(j-1).ToString("d")+"#)";dataGridView1[j+2,i].Value=cmd_jetj.ExecuteScalar().ToString();}progressBar1.Value=i;dataGridView1.FirstDisplayedScrollingRowIndex=i;dataGridView1.Rows[i].Selected=true;}
解决方案
解决方案二:
掉下来了,顶一下。各位帮帮忙。。。。