Click here to Skip to main content
15,798,592 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a combobox that containing names of columns of Table1 and i want to use combobox.text in linq query to make the query more searchable i mean like this
var Q=from s in Table1 where s.+ combobox1.text+ contains ( textbox1.text) select s
please correct this query. thanks
Posted
Comments
praks_1 19-Jul-13 1:08am    
Check this:
var Q=from s in Table1 where s[colName]+ combobox1.text == textbox1.text select s

1 solution

var Q=from s in Table1 where s[colName]+ combobox1.text == textbox1.text
select s;
 
Share this answer
 
Comments
fgeaiessah 19-Jul-13 8:48am    
Thanks very much, but is it necessary to add namespace System.linq.dynamic ?

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