I am trying to write a textbox that will search on 5 DB columns and will return every result of a given search, ex. ‘Red’ would return: red ball, Red Williams, etc. Any examples or similar things people have tried. My example code for the search.
Thanks.
ItemMasterDataContext db = new ItemMasterDataContext(); string s = txtSearch.Text.Trim(); var q = from p in db.ITMSTs where p.IMITD1.Contains(s) || p.IMITD2.Contains(s) || p.IMMFNO.Contains(s) || p.IMITNO.Contains(s) || p.IMVNNO.Contains(s) select p; lv.DataSource = q; lv.DataBind();
You can do something like this (syntax may be off )
or you might want to use this Link or this Link from MSDN.
Happy Coding!!