Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB.net - Macro Substitution
Message
From
13/11/2010 20:35:30
 
 
General information
Forum:
ASP.NET
Category:
LINQ
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01488984
Message ID:
01489061
Views:
77
that is a nice alternative to my Bitwise AND. But at the end of the day i still have to call a function from the LINQ, and that did not work when i tried it with my version.
    Public Function OptionCheck_WithArray(ByRef n_Value1() As Integer, ByVal n_Value2 As Integer) As Boolean
        ' TODO: need to loop through array
        Return If((n_Value2 And n_Value1(0)) = n_Value1(0), True, False)
    End Function
This function will check if a 4 is in 102 (as an example).
I had called that function as follows:
result_0 = result_0.Where(Function(f) OptionCheck_WithArray(SecurityCodes, f.SecurityCode) = True)
but that thoughts an error, don't remember the exact text, but the research of the error reviled that LINQ can not translate that into SQL.
I think that LINQ can not see that function when execution time is up. As I described in my original post, this works if i put the if line directly into the LINQ where command it works, but of course that only works if i have one security code, not a collection thereof.

Any additional thoughts are greatly appreciated.

Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform