C#过滤访问数据库 [英] C# filtering access database
问题描述
你好,我有一个包含产品的Access数据库(他们的名字,来源,价格)
假设我想搜索 Motors b>加拿大和他们的价格是30 $
。我试过这样做,但从来没有达到我的目标,我所做的就是根据一个条件搜索,帮助将不胜感激。
我有什么试过:
i试图修改我在这个视频中使用的代码 C#教程 - 向您的访问应用程序添加搜索功能 - YouTube [ ^ ]但无济于事。
hello , i have an Access database that contains products (their names , origins,prices)
lets say that i want to search for Motors that are made in Canada and their price is 30$
. I Have tried to do so but never reached my goal , all i done is to search according to one condition, help will be appreciated.
What I have tried:
i tried to modify the codes which are used i this video C# Tutorials - Add Search Functionality to your Access application - YouTube[^] but to no avail.
推荐答案
。我试过这样做,但从来没有达到我的目标,我所做的就是根据一个条件搜索,帮助将不胜感激。
我有什么试过:
i试图修改我在这个视频中使用的代码 C#教程 - 向您的访问应用程序添加搜索功能 - YouTube [ ^ ]但无济于事。
. I Have tried to do so but never reached my goal , all i done is to search according to one condition, help will be appreciated.
What I have tried:
i tried to modify the codes which are used i this video C# Tutorials - Add Search Functionality to your Access application - YouTube[^] but to no avail.
尝试:
Try:
SELECT * FROM MyTable
WHERE Type='motor'
AND MadeIn='Canada'
AND Price=30
显然你必须要cha nge表和列名称以适合您的架构。
Obviously you you'll have to change the table and column names to fit your schema.
这篇关于C#过滤访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!