Click here to Skip to main content
16,021,041 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir how to create searchbox to search data in application using database

I want to bind the data entered into the textbox to compare and retrieve from the database when click on the Search button

Select * from wk Where name Like '%" &textBox1.Text& " %'
sir its not work any other query for this
Posted
Updated 31-Oct-10 22:25pm
v3
Comments
RDBurmon 31-Oct-10 5:09am    
Can u give more details about what you want exactly.
what i understand from your question is as :
1) you have a grid or something in your apps and that you populate using a query like 'SELECT * FROM CityMaster'
2) Now you need to create a text box for a search like if any one enter the A and hit the search button then you want to display and city name in grid stucture or something where city name start from a
If is this a scenarion what i am talking about then you need to fire the below query under the search command.
Select * from CityMaster Where CityName Like '" & TextBox1.Text & "%'"
nagababu maridu 31-Oct-10 5:30am    
sir i have customers tabile i want to search directly with customer name are id

1 solution

Can u give more details about what you want exactly.
what i understand from your question is as :
1) you have a grid or something in your apps and that you populate using a query like
SQL
'SELECT * FROM CityMaster'

2) Now you need to create a text box for a search like if any one enter the A and hit the search button then you want to display and city name in grid stucture or something where city name start from a
If is this a scenarion what i am talking about then you need to fire the below query under the search command.
SQL
Select * from CityMaster Where CityName Like '" & TextBox1.Text & "%'"
 
Share this answer
 
Comments
nagababu maridu 31-Oct-10 5:34am    
2nd one is right sir
RDBurmon 31-Oct-10 5:47am    
Hello frnds , if you got solution from any answer then just make it accepted . there is link with this name 'Accept answer' so that forum member need to worry about that you still stuck with the issue you have posted in the forum . right ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900