System.InvalidCastException: Specified cast is not valid.
at System.Data.SqlClient.SqlBuffer.get_Int32()
at Read_PartyProduct(ObjectMaterializer`1 )
at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext()
at System.Data.Linq.EntitySet`1.Load()
at System.Data.Linq.EntitySet`1.GetEnumerator()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at CompiledRazorTemplates.Dynamic.fcaeefbabce.Execute()
at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context)
at System.Web.Mvc.HtmlTemplateBase`1.Run(ExecuteContext context)
at CMS.Core.ITemplateExtensions.Run[T](ITemplate template, T Model)
at CMS.Core.ITemplateExtensions.Parse[T](String template, T Model)
@{var books = ERP.Data.DBContext.Current.Product.Active().OrderByDescending(i => i.DateUpdated).ToList();}

Recently Updated Books

Error:
Unable to cast object of type 'System.Int32' to type 'System.String'.
@{ var db = ERP.Data.DBContext.Current; var authors = db.Party.Active().Where(p => p.TypeId == 1017 && db.PartyProduct.Any(i => i.PartyId == p.Id)); var books = ERP.Data.DBContext.Current.Product.Active(); }

A National Archive of Information

@ERP.Data.Service.BusinessService.ByType("Publisher").Count()

Publishers

Featuring complete portfolio & virtual showroom of @ERP.Data.Service.BusinessService.ByType("Publisher").Count() active Publishers in Bangladesh.

@authors.Count().ToString("#,###")

Authors

Portfolio of an ever growing list of legends. About 3,000 Bengali authors & Poets of the past, present & future.

@books.Count().ToString("#,###")

Books

A complete online catalog of Bangla books. From the everlasting classics to modern literature of the future generation.

Error:
Unable to cast object of type 'System.Int32' to type 'System.String'.