Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

Reading field from ResultSet error when database running on Azure SQL

« Go Back

Information

 
Article Number000098364
EnvironmentProduct: Sitefinity
Version: 10.x
OS: All supported OS versions
Database: Azure SQL
Question/Problem Description
After hosting the database in Azure SQL, accessing the backend UI is throwing an error, "Enum conversion failed as the property/field is not nullable and no value has been read from the database".
Steps to Reproduce
Clarifying Information
Error MessageEnum 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) +285
OpenAccessRuntime.Relational.RelationalGenericState.copyPass1Fields(ResultSet rs, FetchGroupField[] fetchGroups, Int32 firstCol) +237

[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() +7
OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount) +365
OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getNextQueryResult(QueryResultWrapper aQrs, Int32 skipAmount) +42
OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize() +183
OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam) +66
OpenAccessRuntime.ListEnumerator.setCurrent(Int32 _pos) +41
OpenAccessRuntime.ListEnumerator.Move(Int32 relative) +85
OpenAccessRuntime.ListEnumerator.MoveNext() +10
Telerik.OpenAccess.Query.TypedEnumerator`1.MoveNext() +18
Telerik.Sitefinity.Data.Linq.DataItemEnumerator`1.MoveNext() +11
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +186
System.Linq.Enumerable.ToList(IEnumerable`1 source) +61
Telerik.Sitefinity.Web.SiteMapBase.LoadPageDataList(Guid nodeId, PageManager manager) +406
Telerik.Sitefinity.Web.SiteMapBase.GetPageDataContext(Guid nodeId, NodeType nodeType, IList`1 pageDataList, PageManager manager) +153
Telerik.Sitefinity.Web.SiteMapBase.FindDataContext(PageSiteNode node) +255
Telerik.Sitefinity.Web.PageSiteNode.get_PageDataItemContext() +36
Telerik.Sitefinity.Web.PageSiteNode.get_Theme() +12
Telerik.Sitefinity.Web.PageRouteHandler.InstantiateHandler(RequestContext requestContext, PageSiteNode pageDataNode, String& theme) +70
Telerik.Sitefinity.Modules.Pages.PageManager.RenderPage(HttpContextBase context, Guid pageNodeId, Action`1 pageAction) +223
Telerik.Sitefinity.Security.Claims.SignOutHttpHandler.ProcessRequest(HttpContextBase context) +259
Telerik.Sitefinity.Security.Claims.SignOutHttpHandler.ProcessRequest(HttpContext context) +40
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +195
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73
Defect/Enhancement Number
Cause
[framework] field of the record/s for the Page Template inside the database table [sf_page_templates] is set with Null.
Resolution
Set the framework field to 0 to all the records from table [sf_page_templates] where the framework is NULL. To update the records, the following SQL query can be executed against the Sitefinity database:
 
  UPDATE [sf_page_templates]
  SET framework = 0
  WHERE framework IS NULL

 
Workaround
Notes
Keep a  backup of the database before applying the above solution.
Attachment 
Last Modified Date9/11/2019 2:17 PM