i hsve s written a code where in a textbox when i enter any alphabet particular emplyee list shows down with its user id also with it
for eg if i type "su" in textbox it shows up name starting with su if i select my name from the list it will take my name as well as my user id also
on a search button i want to show the projects related to the employee "subin"
the project will be called using userid but the name of the employee is in different table andi want to search project by the name
how wil i do ?
thanks

Jignesh KumarPosted Mar 9, 2019, 12:19 PM
Amit GuptaPosted Mar 9, 2019, 5:12 AM
Siddhartha SharmaPosted Mar 9, 2019, 4:14 AM
rivate void Form1_Load(object sender, EventArgs e)
{
// declare custom source.
var source = new AutoCompleteStringCollection();
// fetch record from database
datatable dt = getdatafromsql("select name from tbl");
// fill database records to custome sorurce
for (i=0;i
{
source.Add(dt.rows[i][0].tostring(););
}
// Create and initialize the text box.
var textBox = new TextBox
{
AutoCompleteCustomSource = source,
AutoCompleteMode =
AutoCompleteMode.SuggestAppend,
AutoCompleteSource =
AutoCompleteSource.CustomSource,
Location = new Point(20, 20),
Width = ClientRectangle.Width - 40,
Visible = true
};
// Add the text box to the form.
Controls.Add(textBox);
}
Subin ThomasPosted Feb 22, 2019, 12:36 AM
Salman BegPosted Feb 22, 2019, 12:06 AM