本文介绍了汇总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.




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

11-02 02:40