将值从gridview放入数据库 [英] Put the value from gridview to the database

查看:75
本文介绍了将值从gridview放入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows窗体gridview中显示了一个表(ReceivePurchase).列名称(字段名称)为:PORecieveNo,OrderDetailNo,PONo,SupplierNo,RawMatNo和ReceivedQuantity.

您如何 将ReceivedQuantity的值 添加到数据库中表RawMats的StockQuantity的 值? >

例如,
gridview列ReceivedQuantity(来自ReceivePurchase表)= 1
库存数量(来自RawMats表)= 1
新库存数量(来自RawMats表)= 2


可以给我字符串查询命令吗?

谢谢!

I have displayed a table(ReceivePurchase) in a windows forms gridview. The column names(field names) are: PORecieveNo, OrderDetailNo, PONo, SupplierNo, RawMatNo, and ReceivedQuantity.

How do you add the value of ReceivedQuantity to the value of StockQuantity of table RawMats in the database?

e.g.,
gridview column ReceivedQuantity(from ReceivePurchase Table) = 1
StockQuantity (from RawMats Table) = 1
New StockQuantity (from RawMats Table) = 2


Can you give me the string query command?

Thanks!

推荐答案

在存储过程中传递(@ supplierid,@ itemquantity),然后

更新RawMats
set stockquantity = stockquantity + @ itemquantity
其中Supplierid = @ supplierid
in stored procedure pass (@supplierid,@itemquantity) then

update RawMats
set stockquantity= stockquantity+@itemquantity
where supplierid=@supplierid


这篇关于将值从gridview放入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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