Category:C#_technology
Article From:https://www.cnblogs.com/hutie1980/p/9059911.html

DataSet6 = DataSet1.Copy();

DataRow[] dr = DataSet6.Tables[0].Select(” Completion status = ‘completion exception’);

DataTable dt1 = DataSet6.Tables[0].Clone();

for (int i = 0; i < dr.Length; i++)
{
dt1.ImportRow((DataRow)dr[i]);

//this.Text = i.ToString();
}

 

// Group by
DataTable dtResult = dt1.Clone();
DataTable dtName = dt1.DefaultView.ToTable(true, “”Out of commission invoice number”, “out of commission order number”, “inventory code”, “the name of the process”, “the number of orders”, “the number of out of the treasury”, “the number of” unpaid “,” CT bad number “,” the original coin contains the tax unit price “,
“The total amount of the original currency tax is “,” the cumulative amount of the invoice amount, “currency”.
for (int i = 0; i < dtName.Rows.Count; i++)
{
DataRow[] rows = dt1.Select(” External Invoice No. = “+ dtName.Rows[i][” Invoice No.].ToString ().
+ “‘ and Outsourcing order number = “+ dtName.Rows[i][” outsourcing Order No. “].ToString ()”
+ “‘ and Inventory code = “+ dtName.Rows[i][” inventory code “].ToString ()”
+ “‘ and The process name = “+ dtName.Rows[i][” process name “].ToString (+ +” “”);
//tempUsed to store filtered data
DataTable temp = dtResult.Clone();
foreach (DataRow row in rows)
{
temp.Rows.Add(row.ItemArray);
}

DataRow dr2 = dtResult.NewRow();
dr2[“The Invoice No. “= = dtName.Rows[i][” Invoice No.].ToString ();
dr2[“Outsourcing Order No. “= dtName.Rows[i][” outsourcing Order No.].ToString ();
dr2[“Inventory code “= = dtName.Rows[i][” inventory code].ToString ();
dr2[“The process name “= = dtName.Rows[i][” is named “].ToString”.
dr2[“Order quantity] = dtName.Rows[i][“order quantity”].ToString (); “
dr2[“The number of outgoing “= = dtName.Rows[i][” is].ToString ().
dr2[“Uncommitted quantity “= = dtName.Rows[i][” did not hand in quantity “].ToString ()”;
dr2[“CTBad number] = dtName.Rows[i][“Long Teng bad number”].ToString ();
dr2[“The original price includes the tax unit price [= dtName.Rows[i][]. The original price includes the tax unit price:].ToString ();
dr2[“The total value of the original tax is “dtName.Rows[i][=”, “].ToString”.
dr2[“The cumulative amount of the invoice amount = “dtName.Rows[i][“, the cumulative amount of the invoice is].ToString ();

dr2[“Currency “] = dtName.Rows[i][” currency “].ToString ();

dr2[“The quantity of warehousing] = temp.Compute (“sum” (quantity in storage) “,” “”.
dtResult.Rows.Add(dr2);
}

//
DataSet9 = new DataSet();
DataSet9.Tables.Add(dtResult);

Leave a Reply

Your email address will not be published. Required fields are marked *