LINQ to fetch record on condition

Hi,

Help me understand what is wrong with my query?
Option Strict On disallows implicit conversions from ‘String’ to ‘Boolean’.

CredentialDT.AsEnumerable.Where(Function( r) in_UserID.Equals(r(“UserID”).ToString and in_Password.Equals(r(“Password”).ToString))).Select(Function® r(“UserName”).ToString).ToList

output variable data type is Systems.Collections.Generic.List<System.String>

in_UserID and in_Password string type and IN direction arguments.

@indrajit.shah
Have a Check on the Missing closing ) for the First Check

CredentialDT.AsEnumerable.Where(Function( r) in_UserID.Equals(r(“UserID”).ToString and in_Password.Equals(r(“Password”).ToString))).Select(Function® r(“UserName”).ToString).ToList

in_UserID.Equals(r(“UserID”).ToString )

1 Like

thank you @ppr I missed the closing and opening brackets

CredentialDT.AsEnumerable.Where(Function(r) in_UserID.Equals(r("UserID").ToString) and (in_Password.Equals(r("Password").ToString))).Select(Function(r) r("UserName").ToString).ToList

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.