Hi all
i am trying to get the biggest number from a field in my database but is it strange because i use this simple code
amenitiesExcel = dc.Hotel_Meals_TBLs.Select(Convert.ToInt32(a => a.CodeNumber)).Max();
and when i compile the query i receive this error
Error 370 The type arguments for method 'System.Linq.Queryable.Select<TSource,TResult>(System.Linq.IQueryable<TSource>, System.Linq.Expressions.Expression<System.Func<TSource,TResult>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
the field "CodeNumber" in the database is a Nvarchar Datatype then is filled only with number and i need to store the biggest number in this
field ,do you have any idea or suggestion how i can get the biggest number in this case?
Thanks so much for the support.
Cheers