Building a search function
-
Hey, im building a page using asp.net (c#). I have never done it before but would like to build a search feature that searches my mysql database and returns relevant results. I have searched the net for help and found some tutorials, altough they are not that good. While in the beginning the search would not be used much its my hope to be getting a lot of people using the search function eventually, so I would like to build it using the best approach so I will not have any bad problems or errors down the line. Does any one know of any good articles, or tutorials that could help me out? thankyou.
-
Hey, im building a page using asp.net (c#). I have never done it before but would like to build a search feature that searches my mysql database and returns relevant results. I have searched the net for help and found some tutorials, altough they are not that good. While in the beginning the search would not be used much its my hope to be getting a lot of people using the search function eventually, so I would like to build it using the best approach so I will not have any bad problems or errors down the line. Does any one know of any good articles, or tutorials that could help me out? thankyou.
Since your search function is simply going to query a database for results, consider this as you would any other MySQL data-access request. You'll have a SELECT statement that supports parameters for retrieving records from your MySQL database. The parameter values will be supplied by your user by entering "whatever" in your "Search" box. You'll execute the query and bind the results to whatever makes sense for your search results (e.g. a GridView, or DataList, or Repeater... depending on how you want the search results to display).