0

i want to get an array of id's which is like ["15", "26", "37", "48", "90"] and i want to get my remaining items from my remaining table that doesnt includes these supplier id's..

here what i done so far:

string[] arrgroupdetails;
arrgroupdetails = dataContext.GroupDetails.Select(c => c.supplier_id).ToArray();

var items = from thingies in dataContext.remainings where thingies.supplier_id.ToString() != arrgroupdetails.Any().ToString() select thingies;

so how can i achive this?

1 Answer 1

1

By heart, so do check syntax but someething like this should work:

var items = from thingies in dataContext.remainings 
where !arrgroupdetails.Contains(thingies.supplier_id.ToString())
select thingies;
Sign up to request clarification or add additional context in comments.

2 Comments

what if the name of supplier_id is different in other table? if its like sup_id in the other table what should i do then? i mean if its like arrgroupdetails = dataContext.GroupDetails.Select(c => c.sup_id).ToArray(); and from thingies in dataContext.remainings where thingies.supplier_id
the name does not matter, you just compare strings in the array to the string in the table

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.