C#小白,关于for循环的一个问题。
这段for循环,如果执行到 MessageBox.Show("1同一整点,公共信息表中存在相同站点"); 这一句,就.一.直.跳.弹.出.窗.口,我想.在.这.后.面.个continue,但.是.也.没.用,一.直.重.复.执.行i=0,是哪.里.有问.题呢?
for (int i = 0; i < ds.Tables["info"].Rows.Count;i++ )//
{
exist ex = new exist();
if (ex.isexit(ds.Tables[0].Rows[i][0].ToString(), strdt))
{
DataCon dc = new DataCon();
SqlConnection sqlcon1 = dc.SqlgetCon();
sqlcon1.Open();
string strcom1 = "select top 1 Eg,UVA from hour_solar_data where Station_ID='" + ds.Tables[0].Rows[i][0].ToString() + "' and Date_Time='" + strdt + "'";
SqlDataAdapter sqldataadapter = new SqlDataAdapter(strcom1, sqlcon1);
DataSet mydataset = new DataSet();
sqldataadapter.Fill(mydataset, "data");//
sqlcon1.Close();
bool UVA = checkUlRadiation(int.Parse(mydataset.Tables["data"].Rows[0][1].ToString()));
bool Eg = checkToRadiation(int.Parse(mydataset.Tables["data"].Rows[0][1].ToString()));
if (UVA && Eg)
{
//
if (ex.PubInfo(ds.Tables[0].Rows[i][0].ToString(), strdt))
{
MessageBox.Show("1同一整点,");
}
else
{
string strcom2 = @"INSERT INTO PubInfo(Programnum,Programname,ObserTime,UpdateTime,Status)
VALUES('" + ds.Tables["info"].Rows[i][0] + "','" + ds.Tables["info"].Rows[i][1] + "','" + strdt + "','" + DateTime.Now + "','0')";
DataOperate dataoper = new DataOperate();
OleDbCommand oledbcom = dataoper.AccDataComm(strcom2);
oledbcom.ExecuteNonQuery();
}
}