开发者

How to search every word separated by comma in textbox

开发者 https://www.devze.com 2023-01-02 05:00 出处:网络
I have text box ...If i type in textbox like \"C,C++,ASP.net,4-5Years\"then every word should be checked by database whether that name exi开发者_StackOverflowts or not in table field of the database.

I have text box ...If i type in textbox like

"C,C++,ASP.net,4-5Years" then every word should be checked by database whether that name exi开发者_StackOverflowts or not in table field of the database. It should be check separately of every word, just like Search engines.

How can i do in asp.net?


This is fairly quick-and-dirty but will get you started.

string[] split = YourTextBox.Text.Split(new char[] {','});
foreach(string str in split)
{
    //check the database about str
    //perhaps using a LIKE query for partial matches
}
0

精彩评论

暂无评论...
验证码 换一张
取 消