数据库循环查询的多条数据如何填充进同一个datatable 数据库循环查询的数据
String lineproduct = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
lineproduct = "select name as 产品名,std_size as 产品规格,object_rrn as 产品RRN,version as 产品版本,description as 产品描述 from meswell.prd_part "
+ "where process_name ='" + dt.Rows[i]["加工工艺"].ToString()
+ "'and customer_name ='" + dt.Rows[i]["客户代码"].ToString()
+ "'and part_spec1 ='" + dt.Rows[i]["客户型号"].ToString()
+ "'and status = 'Active'";
da = SelectOracleDT.getProduct(lineproduct);
}
public static DataTable getProduct(String lineproduct)
{
DataTable dc = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(lineproduct, conn);
da.Fill(dc);
return dc;
}