Blogger Widgets
  • Sharing Photos using SignalR
  • TFS Extenstion - allows copy work items between projects
  • Displaying jquery progressbar with ajax call on a modal dialog
  • Managing windows services of a server via a website
  • Exploring technologies available to date. TechCipher is one place that any professional would like to visit, either to get an overview or to have better understanding.

Search This Blog

Monday, 5 December 2011

NHibernate : Arithmetic overflow error converting expression to data type int

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();
 .Add(Projections.Sum(Projections.Cast(NHibernateUtil.Int64, Projections.Property("imagesize "))).As("TotalSize")))      
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


Copyright © 2013 Template Doctor . Designed by Malith Madushanka - Cool Blogger Tutorials | Code by CBT | Images by by HQ Wallpapers