在Combobox和datagridview中需要帮助. [英] Need help in Combobox and in datagridview.

查看:99
本文介绍了在Combobox和datagridview中需要帮助.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在从ComboBox中选择CustomerName时,我有一个comboBox,总和为
同一客户在不同日期从一张表购买的所有BillAmount
应该显示在datagridview列名称"TotalBillAmount"中
和同一位客户完成的总付款总额应显示在相同的datagridview列名称"Payment"中.
最后是datagridview中的另外两列"AdvanceDeposit"和"Credit".

如果付款金额大于BillAmount金额,则剩余金额应显示在"AdvanceDeposit"中,"Credit"金额为零,反之亦然.
因此,对于该使用哪种查询,如何实现此问题的解决方案.
在此先感谢....

I have a comboBox while selecting CustomerName from ComboBox, Sum of
All the BillAmount purchased by Same Customer in diff dates from one table
should display in datagridview Column Name "TotalBillAmount"
and Sum of total payment done by that same customer should show in same datagridview column Name "Payment".
and finally two more column in datagridview "AdvanceDeposit" and "Credit".

If sum of Payment is more than sum of BillAmount, rest amount should display in "AdvanceDeposit" and "Credit" amount is zero and vice-versa.
So for that what kind of query should i used, how to achieve solution of this problem.
Thanks in Advance....

推荐答案


使用存储过程从db获取TotalBillAmount,Payment.您可以使用聚合函数"SUM"来计算金额,并可以使用客户名称"使用"gropupby"函数对其进行分组.而且AdvanceDeposit和Credit logiic可以写在网格的行数据绑定上.如果您需要更多想法,请告诉我.

谢谢,
Lijo
Hi,
Get the TotalBillAmount,Payment from db using a stored procedure. You can use aggregate function "SUM" to calculate the amount and use "gropupby" function to group it by using Customer Name. And the AdvanceDeposit and Credit logiic can be written on row databound of the grid. Please let me know if you need more idea on this.

Thanks,
Lijo


这篇关于在Combobox和datagridview中需要帮助.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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