2
Answers

How to select an Entity class name from combobox and use it as a variable in a linq to Entities Query ?

Samio

Samio

12y
2.3k
1
Hi,

In My project I have an Entity Model,

In Form1, I have Combobox1 populated with Entities Names (EntityName1, EntityName2, EntityName3)

I wonder how to use the selected value of the combobox as a variable in a linq to Entities Query ?

something like:

var query = (from p in Context.(Combobox.selectedValue) select new { p.ID, p.field1 }).ToList();

Thanks
Answers (2)