As mentioned in
SQL Server Error : Arithmetic overflow error converting expression to data type int article to use cast() in sql to correctly typecast for large numbers, Now this can be achieved using NHibernate & Fluent Hibernate as per the snippet below:-
var criteria = session.CreateCriteria();
criteria.SetProjection(Projections.ProjectionList()
.Add(Projections.Count("ID").As("ID"))
.Add(Projections.Sum(Projections.Cast(NHibernateUtil.Int64, Projections.Property("imagesize "))).As("TotalSize")))
.SetResultTransformer(NHibernate.Transform.Transformers.AliasToBean(typeof(ImagesSummary)));
ImagesSummary summary = (ImagesSummary)criteria.UniqueResult();
I regularly read Internet user groups filled with messages from people trying to solve software incompatibility problems that, in terms of complexity, make the U.S. Tax Code look like Dr. Seuss. ~Dave Barry
Great Article
ReplyDeleteASP.NET MVC Training
Online MVC Training
Online MVC Training India
Dot Net Training in Chennai
.Net Online Training
.net training online
Dot Net Online Training
C# Training