Samio

Samio

  • NA
  • 185
  • 137.3k

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

Jun 8 2012 7:31 AM
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)