comStr.Parameters.Add("@StatusID", SqlDbType.Int);
comStr.Parameters.Add("@IOTime", SqlDbType.DateTime);
comStr.Parameters.Add("@UniqueId", SqlDbType.BigInt);
comStr.Parameters.Add("@DataFlag", SqlDbType.VarChar, 50);
foreach (int i in gridView9.GetSelectedRows())
{
DataRow row = gridView9.GetDataRow(i);
string UniqueId = row[2].ToString();
string IOTime = row[8].ToString();
comStr.Parameters["@StatusID"].Value = "256";
comStr.Parameters["@IOTime"].Value = IOTime;
comStr.Parameters["@UniqueId"].Value = UniqueId;
comStr.Parameters["@DataFlag"].Value = "2";
comStr.ExecuteNonQuery();
//conStr.Close();//关闭连接
}
循环添加和提交,怎样实现循环添加 最后一次提交全部呢?