惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

博客园 - 追逐苦痛

20230509001 - DataTable 导出成Excel 20230425001 - DataGridView绑定了数据之后, 再添加CheckBox列的解决方案 20230424001 - 打开文件对话框OpenFileDialog类 20200812001 - SQL openquery 传参数 ASP.net用Graphics实现的统计图(折线图、柱状图、饼图) 20190917002 - SQL 中处理交叉重复条件参考 20190917001 - 去除DataTable中重复的数据 20190410001 - 遍历控件参考 20180709001 - 委托传值 20180706001 - 动态添加 tabPage 20161020001 DataGridView 选中的 DataGridViewCheckBoxCell 不添加重复项 20161014006 DataGridView Combobox 数据绑定与传值 20161014001 DataGridView 单元格内容 自动计算 20161013001 DataGridView 数据转 DataTable 20161011001 treeView 递归 20160929001 Guid生成 20160815001 - 修改字段的长度 20160715001 - 分发与订阅 总结 20160712001 SQL server R2 更名
20180519001 - DataTable Group by功能参考
追逐苦痛 · 2018-05-19 · via 博客园 - 追逐苦痛

DataSet6 = DataSet1.Copy();

DataRow[] dr = DataSet6.Tables[0].Select(" 完工状态 = '完工异常' ");

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, "委外发票号", "委外订单号", "存货编码", "工艺名称", "订单数量", "出库数量", "未交数量", "CT不良数", "原币含税单价",
"原币价税合计", "累计开票金额", "币种");
for (int i = 0; i < dtName.Rows.Count; i++)
{
DataRow[] rows = dt1.Select(" 委外发票号 ='" + dtName.Rows[i]["委外发票号"].ToString()
+ "' and 委外订单号='" + dtName.Rows[i]["委外订单号"].ToString()
+ "' and 存货编码='" + dtName.Rows[i]["存货编码"].ToString()
+ "' and 工艺名称='" + dtName.Rows[i]["工艺名称"].ToString() + "' ");
//temp用来存储筛选出来的数据
DataTable temp = dtResult.Clone();
foreach (DataRow row in rows)
{
temp.Rows.Add(row.ItemArray);
}

DataRow dr2 = dtResult.NewRow();
dr2["委外发票号"] = dtName.Rows[i]["委外发票号"].ToString();
dr2["委外订单号"] = dtName.Rows[i]["委外订单号"].ToString();
dr2["存货编码"] = dtName.Rows[i]["存货编码"].ToString();
dr2["工艺名称"] = dtName.Rows[i]["工艺名称"].ToString();
dr2["订单数量"] = dtName.Rows[i]["订单数量"].ToString();
dr2["出库数量"] = dtName.Rows[i]["出库数量"].ToString();
dr2["未交数量"] = dtName.Rows[i]["未交数量"].ToString();
dr2["CT不良数"] = dtName.Rows[i]["长腾不良数"].ToString();
dr2["原币含税单价"] = dtName.Rows[i]["原币含税单价"].ToString();
dr2["原币价税合计"] = dtName.Rows[i]["原币价税合计"].ToString();
dr2["累计开票金额"] = dtName.Rows[i]["累计开票金额"].ToString();

dr2["币种"] = dtName.Rows[i]["币种"].ToString();

dr2["入库数量"] = temp.Compute("sum(入库数量)", "");
dtResult.Rows.Add(dr2);
}


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