I am working on a search based or rather data retrival based project i would like to retrive same data for diffrent Keywords usibg texbox contol at front end i am currently able to retrive data using one key coloumn the command i am using is
"select * from maintable where key ='" & TextBox3.Text & "'"
Here i would like to be able to use two keys ie
If user types "pump near 44" or "petrol pump near 44" he may be able to get same data since it means the same

Recommended Answers

Use like keyword instead of equal to

"select * from maintable where key  like '%" & TextBox3.Text & "%'"
Jump to Post

All 2 Replies

Use like keyword instead of equal to

"select * from maintable where key  like '%" & TextBox3.Text & "%'"

Few Things..

1> You can use AJAX Autocomplete Extender to achieve this functionality using the like keyword as suggested Above..

2> It is always good to use parameterized Query..

3> You can use Contains keyword as well if you dont want to use like operator..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.