I have list object and I need to check id in a comma separated string using LINQ in VB.NET, something like this:
dim strId as String = "1,2,3,5,"
dim myList = from objmylist where objmylist.id in (strId)
Your code is perfectly fine if you split the string before using it in the linq In C# you would do this:
string strIDs = "1,2,3,5,";
string[] arrIDs = strIDs.Split(",");
var myList = objmylist.Where(o => arrIDs.Contains(o.id));
Perhaps you can understand this enough to translate it into VB
Using C#,
int[] productList = new int[] { 1, 2, 3, 4 };
var myProducts = from p in db.Products
where productList.Contains(p.ProductID)
select p;
using VB.NET,
Dim productList As Integer() = New Integer() {1, 2, 3, 4}
Dim myProducts = From p In db.Products Where productList.Contains(p.ProductID)
In Reference from Creating SQL IN Queries using LINQ