如何在vb.net或visual Basic 2012中获取Listview项目名称Wise Qty Total [英] how to get Listview Item Name Wise Qty Total in vb.net or visual Basic 2012

查看:79
本文介绍了如何在vb.net或visual Basic 2012中获取Listview项目名称Wise Qty Total的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取Listview项目名称明智数量总额





i有一个Listview赞

< br $>
SrNo |物品名称批次无数量

1 A1 Fsd 10

2 A2 V 10

3 A3 D 10

4 A4 R 10

5 A1 T 10

6 A4 V 10

7 A2 C 10

8 A3 E 10

9 A1 Vc 10

10 A2 G 10

11 A3 H 10

12 A4 D 10

13 A4 N 10







如何获得

物品名称总数量

A1 30

A2 30

A3 30

A4 40



如何在vb.net中输入以上类型

How to Get in Listview Item Name Wise Qty Total


i Have an Listview Like

SrNo |Item Name Batch No Qty
1 A1 Fsd 10
2 A2 V 10
3 A3 D 10
4 A4 R 10
5 A1 T 10
6 A4 V 10
7 A2 C 10
8 A3 E 10
9 A1 Vc 10
10 A2 G 10
11 A3 H 10
12 A4 D 10
13 A4 N 10



How To Get
Item Name TotalQty
A1 30
A2 30
A3 30
A4 40

How To Above Type Total in vb.net

推荐答案

使用简单的SELECT查询,你可以实现。我不会给出确切的查询,但你可以根据你的表结构进行更改。

Using a simple SELECT query, you could achieve that. I'm not going to give exact query but you could change based on your table structures.
--------------------
ItemID ItemName Qty
--------------------
     1 Item1     10
     2 Item2     10
     3 Item3     10
     4 Item4     10
     1 Item1     20
     2 Item2     20
     3 Item3     20
     4 Item4     20
     1 Item1     30
     2 Item2     30
     3 Item3     30
     4 Item4     30
--------------------



获取所有项目的SUM的示例查询在下面


Sample query to get SUM of all items is below

SELECT ItemName, SUM(Qty) FROM TableName GROUP BY ItemName



结果在这里


Result is here

--------------------
ItemName Qty
--------------------
Item1     60
Item2     60
Item3     60
Item4     60
--------------------



将此值绑定到Listview。现在根据您的要求进行定制。



你需要花更多的时间学习。


Bind this values to your Listview. Now customize this for your requirement.

And you need to spend more time on learnings.


这篇关于如何在vb.net或visual Basic 2012中获取Listview项目名称Wise Qty Total的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆