汇总datagrideview中显示的所有值的总和 [英] To gat the total amount of all value showed in datagrideview

查看:88
本文介绍了汇总datagrideview中显示的所有值的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,请帮助我..我是VB的新手,我还剩3天的时间提交我的acedemic项目.问题是
我的数据库中有此字段

Hello Guys , plz help me out ..Me new to VB nd i hv 3 day left to submit my acedemic project.The problem is
there is this field in my database

Date|Partyname|Itemtype|Quantity|ItemPrice|TotalPrice|PaidPrice|BalancePrice|
8/30|abc      |handfree|10      | 10      | 100      |  90     | 10         |
8/30|xyz      |handfres|12      | 10      | 120      |  90     | 30         |



用户将在此处使用文本框输入所有值. 他将仅根据项目价格和输入的价格输入日期,聚会名称,项目类型,数量,必须自动计算总价格..(10 * 10 = 100)
根据此总价,他将输入payedprice,如果有任何余额,它将自动保存在数据库中(100-90 = 10或100-100 = 0)

我无法管理此代码,请帮助我..
请为我做一个演示项目,这样我就可以在我的代码中快速获取它的md实现..plzzz..helpme out



here the the user will enter all the valuse using textbox...
he will enter only date , Partyname , Itemtype , Quantity , base on itemprice nd quantity he hd enter the total price must be calculated automatically..(10*10=100)
Thn based on this total he price he will enter paidprice , nd if there is any balnce thn it will be automaticallu save in database (100-90=10 , or 100-100=0)

Me nt able to mange this code , plz help me out ..
plz make an demo project for me , so tht i can quickly get it md implement on my code..plzzz..help me out

推荐答案

Sujit where you are facing problem you aren't mention properly.
As per your question i can understand that there is a form where you can enter 5 field value and rest of the 2 ie total and balance amount will be calculated and updated in the database.
Do it step by step and you can solve it by yourself then you can learn the project from your end.
If you are using SQL then check how to write SQLconnection string; if Access check OLEDB connection.

Next write insert query inside submit button code. You may apply some trick like while entering quantity write textchanged event and the total amount will be calculated as per text change. Try some validation like while pressing key that should not be char when it is quantity or Item price.
While update paid price write update query so that you record will be updated.
Now come to the grid section.
After entering records that should be displayed on some container you may use grid.
lots of events are there.
Lets start if you are facing any problem share with us.


thnx ..但是我无法计算总金额和余额..

我想要的是用户可以通过名称或日期进行搜索..基于此搜索结果,他将能够计算特定人的总金额..我不知道如何解决此问题...

例如,假设他将为XYZ灼烧,那么它的所有详细信息都将在datagrid视图中显示,那么我想在上面添加两个,一个仅用于计算tht人的总量,另一个用于计算tht人的平衡量.仅...我进行了大量搜索,但无法获得任何解决方案..plz向我提供了演示应用程序... plz ...仅剩2天了,还有很多路要走...

如果您愿意,请通过suju_26pro@ymail.com向我发送邮件.
plzz ..让我离开这里....然后thnx
thnx..But me not able to calculate the total amount and balance amount ..

What i want is the user will search by name or by date ..based on this search result he will able to calculate the total amount of specific person..i dont knw how to tackle this problem...

Eg suppose he will sear for XYZ thn all the deatail of it will be showed in datagrid view , thn i want to add a two butto on it , one to calculate the total amount of tht person only and one for calculating balnce amount of tht person only ...me search a lot but cant get any solution ..plz provide me and demo application ...plz...only 2 days r left still lots to go...

If u do thn mail me on suju_26pro@ymail.com..
plzz..get me out of here....and thnx


我可以解决您的问题.但首先请告诉我您使用的是哪个数据库???
i can solve ur problem.but firstly tell me which database u r using????


这篇关于汇总datagrideview中显示的所有值的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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