带有2个selectParameters的GridView [英] GridView with 2 selectParameters

查看:70
本文介绍了带有2个selectParameters的GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的应用程序上有2个下拉列表.用户将从他的第一个下拉列表中选择一个公司,该公司将填充GridView.然后,用户可以选择仅选择一个公司,或者使用另一个下拉列表选择另一家公司,以将该信息导出到excel.
但是我不能让GridView与第二个下拉列表作为另一个选择参数连接",因为它说变量已经声明.

有人可以帮我吗?

非常感谢.

Hi
I have 2 drop down lists on my application. The user will select a company from he first drop down list which will populate a GridView. The user can then chose to export this information to excel with only one company selected or using the other drop down list select another company.
However I cannot get the GridView to "connect" with the second drop down list as another select parameter as it says the variable is already declared.

Can anyone help me out please?

Many thanks.

推荐答案

缺少更具体的信息,我将做很多假设,并为您提供基本的Windows应用解决方案.相同的一般原理可以应用于Web应用程序,但实现方式略有不同.

基本上,不是直接将Gridview连接到您的下拉菜单,而是使用SelectionChangedCommitted事件告诉您用户何时更改下拉菜单的内容.然后直接为gridview设置SQL以选择所需的数据.在第一个下拉列表中,根据单个下拉列表设置SQL.在第二个步骤中,组合值以生成SQL,该SQL将用您所需的内容填充网格.

希望能有所帮助.如前所述,请记住用语言等标记您的帖子,并提供足够的详细信息,以便给出直接解决问题的答案,而不仅仅是一般性的描述.
Lacking more specific information I''m going to assume a lot and give you a basic windows app solution. The same general principle can be applied to a web app but the implementation is slightly different.

Basically instead of directly connecting the Gridview to your drop down, use the SelectionChangedCommitted event to tell you when the user changes the contents of the drop down. Then directly set the SQL for the gridview to select the data you want. In the first drop down, set the SQL based on the single drop down. In the second, combine the values to produce SQL that will fill the grid with what you need.

Hope that helps. As previously mentioned, remember to tag your posts with language etc. and give enough details so it''s easier to give an answer that is a direct solution to your problem rather than just a generic description.


这篇关于带有2个selectParameters的GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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