I would like to develop a "live" search control which displays the results in a popup menu when entering letters in a textbox. The data comes from a web service and a database on the LAN. My first thought was something like that (executing in a thread):
while (true)
{
start:
if (searchTermChanged)
{
clearData();
showPopup();
//get and add data from Webservice
if (searchTermChanged) goto start
//get and add data from database (query 1)
if (searchTermChanged) goto start
//get and add data from database (query 2)
}
Threading.sleep(10);
goto start;
}
But somehow I do not like this solution! What do you think?