Need urgent help---Google like search in an windows application

Posted by Tanvi under C# on 8/5/2009 | Views : 3466 | Status : [Member] | Replies : 1
I am new to C# and want to create an application which has Google like search mechanism.
Whenever we try to type an letter of an word, corresponding keywords are displayed in a popup. For that I have taken a textbox and a list box. The listbox acts as the popup and I am making it visible only when the key press event of textbox is generated.
I have also created a list and have bind it to the listbox using the DataTable. Now when I am trying to search the corresponding keywords, I am searching it into the Datatable. I am not getting any error but I am not even getting the output.
Following is the code snippet....

public void CreateCollection()
dt = new DataTable("ListItems");
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("ID", typeof(int));
dt.Columns.Add("Address", typeof(string));

DataRow dr;
dr = dt.NewRow();
dr["Name"] = "aaa";
dr["ID"] = 1;
dr["Address"] = "Mumbai";

DataRow dr1;
dr1 = dt.NewRow();
dr1["Name"] = "bbb";
dr1["ID"] = 1;
dr1["Address"] = "Mumbai";


pubilc void SearchItem()
lbSearch.DisplayMember = "Name";
lbSearch.ValueMember = "Name";
string Item = dt.Select("Name=aaa").ToString();


Posted by: Poster on: 8/5/2009 [Member] Starter

Please go through following link and you should get the solution.


Tanvi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response