' had to spread this - the UT compiler did not like that one < F l a g s ()> _ Public Enum e_SecurityCodes DMS_Accounting_All = 2 DMS_Accounting_AR = 4 DMS_Accounting_AP = 8 DMS_Accounting_PR = 16 DMS_All = 32 DMS_Client = 64 DMS_HR_Employee = 128 DMS_HR_Caregiver = 256 DMS_HR_All = 512 End Enum Module SecurityTest ' had to spread this - the UT compiler did not like that one < S y s t e m .Runtime.CompilerServices.Extension()> _ Public Function IncludesCode(ByVal DocSecurityValue As Integer) As Boolean Dim sc As New e_SecurityCodes If sc.HasFlag(DirectCast(DocSecurityValue, e_SecurityCodes)) Then Return True End If Return False End Function End Module Partial Public Class _Default ... Protected Sub Search_Btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Search_Btn.Click, Search_Btn2.Click ... Dim db = New DataClassesDataContext() Dim result_0 = From col_Row In db.Masters, z In db.DocumentTypes Select ListCol = System.Convert.ToDateTime(col_Row.Doc_Dte).Month.ToString.PadLeft(2, "0") & "/" & System.Convert.ToDateTime(col_Row.Doc_Dte).Day.ToString.PadLeft(2, "0") & "/" & System.Convert.ToDateTime(col_Row.Doc_Dte).Year.ToString.Substring(2, 2) & " | " & col_Row.Doc_Type_Level3.Trim.Substring(0, 28).PadRight(28, ".") & " | " & col_Row.Resource_ID.ToString.Trim.Substring(0, 6).PadRight(6, ".") & " | " & col_Row.Resource_First.Trim.Substring(0, 14).PadRight(14, ".") & " | " & col_Row.Resource_Last.Trim.Substring(0, 15).PadRight(15, ".") & " | " & col_Row.Vendor_Name.Trim.Substring(0, 19).PadRight(19, "."), ... Doc_Type_Level1 = col_Row.Doc_Type_Level1, Doc_Type_Level2 = col_Row.Doc_Type_Level2, Doc_Type_Level3 = col_Row.Doc_Type_Level3, Type_Level1 = z.Type_Level1, Type_Level2 = z.Type_Level2, Type_Level3 = z.Type_Level3, SecurityCode = z.SecurityCode Order By Patient_Last ... result_0.ToList() Dim result_Match = (From x In result_0 Where IncludesCode(x.SecurityCode) Select x).ToList() End Sub End ClassMy research tells me that that error means linq can not translate the function into a sql statement and the function (obviously) will not be available to sql when the sql-statment gets executed.