string strZG = "Select Assembly_parts_T,Assembly_parts_TB,Assembly_parts_B,Assembly_parts_SD,Assembly_parts_SO From T_ZG_Assembly355 Where T_ZG_Assembly355.Assembly_no='" + cmbAssNoOpe.Text + "'";
conn = DBConn.GetConn();
da = new OracleDataAdapter(strZG, conn);
ds = new DataSet();
da.Fill(ds, "tab1");
int columns = ds.Tables["tab1"].Columns.Count;
string[] dataArray = new string[columns];
List<string> strSqls = new List<string>();
for (int j = 0; j < columns; j++)
{
dataArray[j] = ds.Tables["tab1"].Rows[0][j].ToString();
if (dataArray[j] !="") //此处不用dataArray[j] !=null 否则当查询的某个单元格为空值时,依旧会执行下面的SQL语句。
{
string strSQL2 = "Update T_ZG_BasicInfor Set Assembly_State='组装' Where Tool_No='" + dataArray[j] + "'";
strSqls.Add(strSQL2);
}
conn = DBConn.GetConn();
da = new OracleDataAdapter(strZG, conn);
ds = new DataSet();
da.Fill(ds, "tab1");
int columns = ds.Tables["tab1"].Columns.Count;
string[] dataArray = new string[columns];
List<string> strSqls = new List<string>();
for (int j = 0; j < columns; j++)
{
dataArray[j] = ds.Tables["tab1"].Rows[0][j].ToString();
if (dataArray[j] !="") //此处不用dataArray[j] !=null 否则当查询的某个单元格为空值时,依旧会执行下面的SQL语句。
{
string strSQL2 = "Update T_ZG_BasicInfor Set Assembly_State='组装' Where Tool_No='" + dataArray[j] + "'";
strSqls.Add(strSQL2);
}
}
strSqls.Add(strSQL1);