C#创建一个搜索选项 [英] C# create a search option

查看:68
本文介绍了C#创建一个搜索选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要Windows格式的搜索选项帮助。



我尝试过:



我试图找出如何将搜索功能添加到Windows窗体。我有一个有三种选择的组合框。代码,名称,城市。当您选择一个时,我需要打开另一个框以输入搜索条件,然后以网格格式返回值。我已经看到了获取网格设置的示例,但无法找出搜索部分。任何想法/例子将不胜感激。 

解决方案

这是一篇关于如何使用 SELECT 命令连接和查询MySQL数据库的基础文章:

将C#连接到MySQL [ ^ ]

更多相关信息这里的SQL: SQL SELECT语句 [ ^ ]


我能够解决这个问题。


< blockquote>



假设你有一个名为'Code','Name','City'和Textbox2 / Combobox2的combobox1用于输入searchValue。





TextBox2 / ComboBox2 TextChange事件你可以检查所选的combobox1值,如Code或其他你可以查询在DataBase中显示可能的值以在网格中显示。





希望这对您有所帮助。



**如果发现有用,则标记为答案。



问候,

Jatinath


Need help with search option in Windows form.

What I have tried:

I am trying to figure out how to add a search feature to a windows form. I have a combobox with three options. Code, Name, City. When you choose one, I need another box to open to enter search criteria and then return values in a grid format.  I have seen examples on the getting the grid setup, but cannot figure out the search part. Any ideas / examples would be appreciated. 

解决方案

Here is a basic article on how to connect and query MySQL database with the SELECT command:
Connect C# to MySQL[^]
More information about SQL here: SQL SELECT Statement[^]


I was able to figure this out.


Hi,

suppose you have combobox1 with values 'Code', 'Name', 'City' and Textbox2/Combobox2 for enter searchValue.


on TextBox2/ComboBox2 TextChange event you can check for selected combobox1 value like Code or other and according you can query in DataBase for possible values to show in grid.


Hope this will help you.

**Mark as Answer if found useful.

Regards,
Jatinath


这篇关于C#创建一个搜索选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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