如何添加2列的整数并在文本框中显示? [英] How Can I Add The Integers Of 2 Columns And Display It In A Textbox?

查看:90
本文介绍了如何添加2列的整数并在文本框中显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为tbproduct(P_id,P_price,P_interest,P_barcode)的表我想添加P_price和P_interest中的值并将其显示在文本框中,例如,如果P_price为100且P_interest为20,则文本框应显示120

i不知道该怎么做

谢谢!

解决方案

这是4个不同的问题:

- 如何对我的SQL基础做一个请求。

- 如何获得请求的结果。

- 如何添加2个值从结果。

- 如何在TextBox中放置一个值。



哪一个对你有问题?

你做了什么?



如果什么也没做,你的分析方法有问题吗?


< pre lang =SQL> SELECT P_id,P_price,P_interest,P_barcode,(P_price + P_interest) as T_price tbproduct



然后你可以设置T_price val即文本框文本


I have a table named tbproduct (P_id,P_price,P_interest,P_barcode) i want to add the values from P_price and P_interest and display it in a textbox for example if P_price is 100 and P_interest is 20 then the textbox should display 120
i have no idea how to do that
thank you!

解决方案

That is 4 different questions:
- How to do a request to my SQL base.
- How to get the result of the request.
- How to add 2 value from the result.
- How to put a value in TextBox.

Which one is a problem for you ?
What have you done ?

If done nothing, do you have a problem with your analyse method ?


SELECT P_id,P_price,P_interest,P_barcode, ( P_price+ P_interest) as T_price  tbproduct


then you can set T_price value as textbox text


这篇关于如何添加2列的整数并在文本框中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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