More in this section

Forums / Developing with Sitefinity / Error while inserting data in custom module.

Error while inserting data in custom module.

2 posts, 0 answered
  1. Jagjot
    Jagjot avatar
    3 posts
    17 Jul 2012
    27 Dec 2012
    Link to this post


    I have create my own custom module named StudentsModule following the steps as specified in products module. Module is installed but when i try to create record from the backend of the module. I get the following exception:

    System.NullReferenceException: Object reference not set to an instance of an object.

       at OpenAccessRuntime.Relational.metadata.RelationalTable.createPkEqualsParamExp(SelectExp se)
       at OpenAccessRuntime.Relational.RelationalStorageManager.getGetStateFetchSpec(FetchPlanIF fPlan, Boolean includeSubclasses, OID oid)
       at OpenAccessRuntime.Relational.RelationalStorageManager.getStateImp(RelationalOID oid, FetchPlanIF fPlan, Boolean forUpdate, StateContainer container, RelationalClass relationalClass)
       at OpenAccessRuntime.Relational.RelationalStorageManager.getState(OID oid, FetchPlanIF fPlan, StateContainer container)
       at OpenAccessRuntime.Relational.RelationalStorageManager.fetch(ApplicationContext context, OID oid, State current, FetchPlanIF fPlan, FieldMetaData triggerField)

    I have sdk of SF version 5.2 so i have set the open access target path as  

     <OpenAccessPath>C:\Program Files\Telerik\Sitefinity 5.2\SDK\Content\Common\Dependencies</OpenAccessPath>

    but the sitefinity application is built in sitefinity version 5.1. Is the error coming because of this version difference?

  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    18 Sep 2017
    01 Jan 2013
    Link to this post

    The stack trace of the error indicates a problem in metadata which is an inication that the module is not enhanced
    at OpenAccessRuntime.Relational.metadata.RelationalTable.createPkEqualsParamExp(SelectExp se)

    In the .csproj file of the module make sure you have the end of the .cspro file like this:

    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
          <UserProperties OpenAccess_ConfigFile="App.config" OpenAccess_ConnectionId="DatabaseConnection1" OpenAccess_Enhancing="True" OpenAccess_UpdateDatabase="False" OpenAccess_EnhancementOutputLevel="1" />
    <!-- enter the path here -->
        <OpenAccessPath>C:\Program Files\Telerik\Sitefinity 5.2\SDK\Content\Common\Dependencies</OpenAccessPath>
      <Import Condition="Exists('$(OpenAccessPath)\OpenAccess.targets')" Project="$(OpenAccessPath)\OpenAccess.targets" />

    All the best,
    Stanislav Velikov
    the Telerik team
    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
2 posts, 0 answered