搜索SQL数据库 [英] Searching Sql database

查看:104
本文介绍了搜索SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿.我有一个菜单控件,其中包含我手动输入的项目.它没有绑定到数据库.我还有一个checkboxlist控件,其中包含我再次手动输入的项目,并且也未绑定到数据库.当用户必须在数据库中输入数据并将数据存储在数据库中时,我确实在数据库中具有必需的表.但是,我该如何在vb 2010中编写搜索代码?该数据库已经非常复杂,因此我试图避免在其中放入太多表.为了更好地解决最初的问题并增加清晰度,菜单控件具有用户必须选择以搜索服务提供商的区域列表,并且复选框列表具有作业(例如tiler,builder等).单击搜索按钮时,数据网格必须显示必需的信息.

感谢

Hey. i have a menu control with items that i put in manually. It is not bound to the database. I also have a checkboxlist control with items that i again put in manually and is also not bound to the database. I do have the required tables in the database for when the user has to input and store the data in the database. But how do i code the search in vb 2010? the database is already quite complex and im trying to avoid putting in too many tables in it. To better the initial question and too add clarity, the menu control has a list of areas that a user has to choose to search for a service provider and the checkboxlist has jobs example tiler, builder etc. When the search button is clicked, the datagrid must show the required information.

thanks

推荐答案

您需要使用搜索逻辑编写存储过程,才能根据用户通过复选框在表单上提供的输入进行搜索.通读一些有关如何创建存储的proc以及如何将联接放在表上的基本文章.
You need to write Stored procedure with a search logic to do the search based on the input that user would provide on the form through checklistbox. Read through some of the basic articles on how to create stored proc and putting joins on tables.


这篇关于搜索SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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