AutoComplete text Boxes with Like Operators..

Autocomplete Text Box with Like Keyword faciltu...

For this

Just Get all the data in a daatreader from the database which u want to bind with the TextBox..

and after that add the data reader in a "AutoComplete" object..


After that simply assing the Object to the text Box..


This will enable u to search all the Values which are contain in the Database.. Including the Like operator....



private void AddAutoComplete()
{
AutoCompleteStringCollection AutoCompMN = new AutoCompleteStringCollection();


AutoCompMN.Add("");

SqlDataReader drd;
drd = DobjUser.AutoComplete();

if (drd.HasRows)
{
while (drd.Read())
{

AutoCompMN.Add(drd["ManufacturerName"].ToString());

AutoCompOD.Add(drd["OriginalDealerName"].ToString());
}
}

txtMName.AutoCompleteMode = AutoCompleteMode.Suggest;
txtMName.AutoCompleteSource = AutoCompleteSource.CustomSource;
txtName.AutoCompleteCustomSource = AutoCompMN;
}

}




Thanks


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: