troubleshooting Question

VB.net Linq Query exclude whats in list

Avatar of bguenther
bguenther asked on
Visual Basic.NETMicrosoft SQL Server 2008SQL
17 Comments1 Solution2850 ViewsLast Modified:
Hi,

I have a query that is suppose to get vendors from an sql table, i have an arraylist that contains ID's and i do not want the query to return vendors with those ID's that are in the array list.
This is what i have but it is not working i get a message saying "Method 'Boolean Contains(System.Object)' has no supported translation to sql"

qVendors = From TempVendor In DBV.Vendors _
                               Where Not arrExcludeList.Contains(TempVendor.ListID)
                               Select TempVendor

arrExcludeList contains all the ids that i DON'T want to return.

If anybody can see what i am doing wrong please help.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 17 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros