error in linq query and combobox -


what's problem code:

_department.valuemember = "id";   var query = db.table.asqueryable();  query  = query.where(d => d.departmentid   == _depatment.selectedvalue int?  ); 

i error: unable create constant value of type 'system.object'. primitive types ('such int32, string, , guid') supported in context.

i changed code , problem resolved:

int selectedvalue = int.parse(_department.selectedvalue.tostring()); query  = query.where(d => d.departmentid   == selectedvalue  ); 

thank cameron :)


Comments