Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21264

LINQ contains method

$
0
0
i am trying to get the results of products from database by matching them with the product id stored in List Of(Orders)
but then they gave me some error on the last line saying : "Only arguments that can be evaluated on the client are supported for the String.Contains method."
whats the problem here O.O? (newbie to VB, sorry if this seems stupid)

Code:

        Dim idString As String = ""

        For Each item In order
            idString &= item.ProductId & " "
        Next

        Dim rs = From p In db.Products
                Where idString.Contains(p.ProductId)

        dgvOrder.DataSource = rs


Viewing all articles
Browse latest Browse all 21264

Trending Articles