Enum conversion failed as the property/field is not nullable

Posted by Community Admin on 05-Aug-2018 00:37

Enum conversion failed as the property/field is not nullable and no value has been read from the database.

All Replies

Posted by Community Admin on 05-Dec-2013 00:00

I am attempting to publish the Corporate Starter Kit to Azure.  My plan is to modify it once it is deployed.  The only changes I have made so far are those required for the manual deployment and some web.config changes related to the handlers and modules as the default web.config in the Corporate Starter Kit doesnt work with IIS 7.5.  It works fine on my local system with my database deployed on my local system.  However once I move my database to Azure and point my local project at it I get the failure mentioned in the my last post.  The same is true when I deploy my project to azure.  Thanks in advance anything you can do to help me out here is greatly appreciated.   The error I am getting is below.

Server Error in '/' Application.

Enum conversion failed as the property/field is not nullable and no value has been read from the database.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Enum conversion failed as the property/field is not nullable and no value has been read from the database.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Enum conversion failed as the property/field is not nullable and no value has been read from the database.]
   OpenAccessRuntime.Data.EnumConverter.Read(DataHolder& holder) +470
   OpenAccessRuntime.Relational.RelationalGenericState.copyPass1Fields(ResultSet rs, FetchGroupField[] fetchGroups, Int32 firstCol) +346

[DataStoreException: Error reading field Telerik.Sitefinity.Pages.Model.PageTemplate.framework from ResultSet: System.InvalidOperationException: Enum conversion failed as the property/field is not nullable and no value has been read from the database.
   at OpenAccessRuntime.Data.EnumConverter.Read(DataHolder& holder)
   at OpenAccessRuntime.Relational.RelationalGenericState.copyPass1Fields(ResultSet rs, FetchGroupField[] fetchGroups, Int32 firstCol) System.InvalidOperationException: Enum conversion failed as the property/field is not nullable and no value has been read from the database.
   at OpenAccessRuntime.Data.EnumConverter.Read(DataHolder& holder)
   at OpenAccessRuntime.Relational.RelationalGenericState.copyPass1Fields(ResultSet rs, FetchGroupField[] fetchGroups, Int32 firstCol)]
   OpenAccessRuntime.ExceptionWrapper.Throw() +13
   OpenAccessRuntime.DataObjects.PCStateMan.handleException(Exception x) +101
   OpenAccessRuntime.DataObjects.PCStateMan.getObjectFieldImp(PersistenceCapable pc, FieldMetaData fmd, Object currentValue) +183
   Telerik.Sitefinity.Pages.Model.PageData.OpenAccessEnhancedGettemplate(PageData owner) +86
   Telerik.Sitefinity.Pages.Model.PageData.get_Template() +18
   Telerik.Sitefinity.Web.PageSiteNode..ctor(SiteMapBase provider, PageNode pageNode, String pageProviderName) +3115
   Telerik.Sitefinity.Web.SiteMapBase.FindSiteMapNodeFromKey(String key, Boolean ifAccessible) +1402
   Telerik.Sitefinity.Web.SiteMapBase.FindSiteMapNode(String rawUrl, Boolean ifAccessible, Boolean unresolveUrl, Boolean& isAdditionalUrl, String[]& urlParameters) +599
   Telerik.Sitefinity.Web.SitefinityRoute.FindSiteMapNode(String& virtualPath, SiteMapBase siteMapProvider, Boolean& isAdditional, String[]& pars, Boolean skipSubSiteCheck) +512
   Telerik.Sitefinity.Web.SitefinityRoute.GetRouteData(HttpContextBase httpContext) +257
   System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +355
   System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +75
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.2026

 

Posted by Community Admin on 05-Dec-2013 00:00

I am expecting this is something very simple that could be azure related.  However I am not very familiar with azure so starting here for assistance.

Posted by Community Admin on 09-Dec-2013 00:00

Hello,

To resolve the issue execute the below query against the database uploaded in Azure

update sf_page_templates
set framework = 0
where framework is null
This will make all templates have their column framework have default value 0 instead of NULL, the default value for the column is null and this works locally, however when SQL Azure handles this it requires not nullable value.
After this restart the site and the problem will be no more.

The column framework was inappropriately populated with Null value which causes a problem, we haven`t determined the cause for this.

Regards,
Stanislav Velikov
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed