通过执行存储过程填充数据网格视图组合框列和文本框 [英] Fill data grid view combo box column and text box by executing stores procedure

查看:81
本文介绍了通过执行存储过程填充数据网格视图组合框列和文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要通过商店程序填写datagridview组合框列(包)。 SP的参数值将取自上一列(产品)。



选择产品列后,应根据商店程序加载包装一旦包装选择unitbuy必须显示为费率。





我创建了datagirdview组合框专栏

Hi,

I need to fill datagridview combobox column(Package) by stores procedure. The parameter value for the SP will be taken from previous column (Product).

once the product column is selected then the packing should be loaded as per the stores procedure and once packing has selected "unitbuy" has to be shown as rate.


I have created datagirdview combo box column

Dim Combopkg As New DataGridViewComboBoxColumn
      With Combopkg
          .HeaderText = "Package"
          .DataPropertyName = "PackID"
          .datasour=????
          .DisplayMember = "PKG"
          .ValueMember = "ID"
          .Name = "PackID"
          .Width = 75
      End With



我不知道如何提供数据源..



我的商店程序,我已经在sql中创建如下,


I dont know how to give datasource..

my stores procedure, which i already created in sql as follows,

Create proc [dbo].[spPkgBuy]

@PDT int
as
Begin

select ID,PKG,UnitBuy from vpkg where PDTID=@PDT

end





因此,如果DGV单元格(产品)的值已更改,则存储过程应适用于下一列。将加载特定产品ID的包装。商店程序就是这样设计的。一旦选择了包,那么来自商店程序的unitbuy值应填入DGV.cells(Rate),但它不应该是只读的。填充率列之后,我也可以编辑它。



我发布了 msdn中的同一个问题 [ ^ ]但没有回复..







请帮帮我..



谢谢



So if the value of DGV cells("Product") has changed then stores procedure should work for next colum. Packing of particular product id will be loaded. The stores procedure is designed like that. Once package has selected then unitbuy value from store procedure should filled in DGV.cells("Rate") but it should not be read only. After filling rate column also, i can edit it.

I have posted same question in msdn [^]but no reply has got..



Please help me..

thanks

推荐答案

我认为这是Link [ ^ ]将帮助您
i think this Link[^] will help you


这篇关于通过执行存储过程填充数据网格视图组合框列和文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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