vb.net - Cannot use an entityset inside my linq to sql query -


when try query database retrive activity selected crew, give "loca sequence error"

this code:

private lst_active new entityset(of activity)    private crw_list new entityset(of crew)  checklistbox.items.addrange(dbase.crew) 

then choose crew in checklistbox , selected crews insert entityset of crew further use.

crw_list.addrange(checkedlistbox.checkeditems)  lst_active.addrange(from x in dbase.stored_activities join z in crw_list on x.emp_no  equals z.emp_no                     select x) 

is there way around? or im doing wrong?

you haven't said how model looks like, following concept should work:

dim active = (from x in dbase.stored_activities               join z in dbase.stored_crews on x.emp_no  equals z.emp_no               select x).tolist() 

update

if have local in-memory collection , need items field matching 1 within collection, use contains instead:

from x in dbase.storedactivities locallist.contains(x.emp_no) select x 

your list should contain joining column* only, in case should made crw_list.select(function(x) x.emp_no).


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -