SQL查询,使用多个单选按钮进行过滤 [英] SQL Queries, filter with multiple radio Buttons

查看:93
本文介绍了SQL查询,使用多个单选按钮进行过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何使用SQL查询过滤datagridview的方法,以便同时满足两个条件才能使数据不仅显示出来.

I am trying to figure out how to filter my datagridview with SQL queries so that both of them have to be met for data to show up not just one.

我的datagridview绑定到Access数据库.

My datagridview is bound to an Access Database.

我基本上希望按宽度"和木材类型"进行过滤

I basically would want it filtered by 'Width' and 'Wood Type'

我在组框中有单选按钮,因此可以选择宽度和木材.但是,一次只能应用一个查询.

I have radio buttons in group boxes so a width and wood can be selected. However only one Query is applied at a time.


推荐答案

我不确定您如何绑定到Access数据库表,但是您是否创建了BindingSource来做到这一点? BindingSource具有一个Filter属性,可用于指定数据条件.

I'm not really sure how you are binding to the Access database table, but did you create a BindingSource to do this? The BindingSource has a Filter property that you can use to specify the criteria for the data.

这也可以通过TableAdapter Fill方法完成,如果那恰好是您用作数据源的方法.

This can also be done through a TableAdapter Fill method if that happens to be what you are using as the data source.


这篇关于SQL查询,使用多个单选按钮进行过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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