Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How i can do multiple value search using linq to sql for example i have two textbox
textbox1 and textbox2 and in both the textbox i can enter multiple value and on the Button click i want to search record based on the values enter in the textbox
Posted
Comments
Henry Minute 18-Feb-11 15:08pm    
What have you tried?

Please use 'Improve question' to edit your question and include your code.

1 solution

Try this

NorthwindDataContext db = new NorthwindDataContext();

var products = from p in db.Products where p.ProductName == txtBox1.Text || 
p.ProductName == txtBox2.Text select p;
 
Share this answer
 
v2
Comments
HimanshuJoshi 18-Feb-11 17:14pm    
Edited to add pre tags.
javed_.net 19-Feb-11 4:14am    
thnx for your reply..but in my case i have to insert multiple value in both the txtBox1 and txtBox2.
for exp txtBox1(name1,name2....)txtBox2(prod1,prod2....)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900