hi all,
i have a linq statement that returns a resultset from a domainservice - what i'm really after is the number of records, not the records themselves and for the life of me cannot get it....code is below and any help would be appreciated:
The table is called login and is associated with its entity dataset called logins - the project is called EstimatorSilverlight
Code:Public Function GetLoginsByName(ByVal username As String, ByVal password As String) As IQueryable(Of login) Dim count As Integer = Me.ObjectContext.logins.Where(Function(t) t.username = username AndAlso t.password = password).AsQueryable().Count() Return count End Function
The error is "Value of type 'Integer' cannot be converted to 'System.Linq.IQueryable(Of EstimatorSilverlight.Web.login)'.
the original code that successfully returns the resultset is here:
Code:Return Me.ObjectContext.logins.Where(Function(t) t.username = username AndAlso t.password = password)




Reply With Quote