根据用户输入查询 [英] Query based on user input
本文介绍了根据用户输入查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家新郎如何根据用户输入创建查询,例如: (数据库字段名= textbox1.text,数据库字段id = textbox2.text)然后在datagridview中显示此数据。
感谢
Giggig Enterprises
http ://www.giggig.co.uk/
Hi guys
How would I create a query based on user input e.g. (database field name = textbox1.text, database field id = textbox2.text) and then show this data in a datagridview.
Thanks
Giggig Enterprises http://www.giggig.co.uk/
推荐答案
您需要为此使用参数化查询或存储过程。以下是一些使用参数化查询/ SP查询数据的示例
http://support.microsoft.com / kb / 310070
http://support.microsoft.com/kb/301075
加载DataSet / DataTable后,只需将其绑定到网格
You would need to use parameterized query or stored procedure for this. Here are some samples how to query data using parameterized queries/SPs
http://support.microsoft.com/kb/310070
http://support.microsoft.com/kb/301075
After DataSet/DataTable is loaded, you can simply bind it to the grid
这篇关于根据用户输入查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文