0

I have a textbox for searching in my access database. For example, my database is dbEmpLis; my table name is tblEmployee; columns in my tblEmployee are fName, lName and mName. What I want to do is,when a user type to the search box, and click the search button, it will search to the database.Then if it find any match within the database it will return the value/s to the listbox.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Techyon
0

khentz,
I'm curious which are you wanting to fill ListView or ListBox? You're title say one and your question says another.

Ken

0

Hi

Declare a new DataSet, then execute a standard query to populate the DataSet.

Dim sqlString As String = ("SELECT tblEmployee.fName, tblEmployee.lName, tblEmployee.mName FROM tblEmployee WHERE tblEmployee.fName LIKE '%" & txtSearch.Text & "%'")

txtSearch.Text is an textbox on the form.

Go into a "for each" loop and place it into a list/grid-view.

Hope this helps.

Try reading up on queries if your going to be working with databases..

http://www.w3schools.com/sql/default.asp

This would be an excellent place to start.

Edited by Techyon: Additonal Information.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.