Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using LINQ to query an entitylist
Message
From
04/05/2009 12:32:35
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Using LINQ to query an entitylist
Miscellaneous
Thread ID:
01397790
Message ID:
01397790
Views:
109
I’m trying to query and entitylist
Public Function CheckForDupe(ByVal itemid As String) As Boolean
Dim founditem As IEnumerable(Of VwRequistionQuickviewEntity) = From p In Me.EntityList Where p.ItemId.Trim = itemid.Trim Select p
If Not founditem Is Nothing Then
    If founditem.Count > 0 Then
           Return True
    End If
End If
Return False
I always get the following error
Object reference not set to an instance of an object.
StackTrace:
at NYSTAX.APPDEV.ICS.Business.VwRequistionQuickview._Closure$__1._Lambda$__1(VwRequistionQuickviewEntity p) in D:\Projects\ICS\ICSBusiness\VwRequistionQuickview\VwRequistionQuickview.Partial.vb:line 28
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
at NYSTAX.APPDEV.ICS.Business.VwRequistionQuickview.CheckForDupe(String itemid) in D:\Projects\ICS\ICSBusiness\VwRequistionQuickview\VwRequistionQuickview.Partial.vb:line 30

Any Idea what I’m doing wrong ?
Next
Reply
Map
View

Click here to load this message in the networking platform