datatable 增加一行並賦值
阿新 • • 發佈:2019-02-16
tablesm.Columns.Add("MAIN_MODEL", typeof(string));
for (int i = 0; i < tablesm.Rows.Count; i++)
{
string wo = tablesm.Rows[i]["work_order"].ToString(); string SQL = "select MAIN_MODEL1 from SFC.R_WO_BASE_T where work_order='" + wo + "' ";
DataTable table = new DataTable();
table = ut.OracleDataQuery(SQL, ConnectionStringReprot); string MAIN_MODEL1 = table.Rows[0]["MAIN_MODEL1"].ToString();
tablesm.Rows[i]["MAIN_MODEL"] = MAIN_MODEL1;
}
for (int i = 0; i < tablesm.Rows.Count; i++)
{
string wo = tablesm.Rows[i]["work_order"].ToString(); string SQL = "select MAIN_MODEL1 from SFC.R_WO_BASE_T where work_order='" + wo + "' ";
DataTable table = new DataTable();
table = ut.OracleDataQuery(SQL, ConnectionStringReprot); string MAIN_MODEL1 = table.Rows[0]["MAIN_MODEL1"].ToString();
tablesm.Rows[i]["MAIN_MODEL"] = MAIN_MODEL1;
}