I am using MyGeneration 1.2.0.7 to generate the entityspaces code for encapsulating the DNN Announcements module. However I am getting the weirderst error whenever I attempt to load a single entity from a collection, or via LoadByPrimaryKey. The error is
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: D:\Inetpub\wwwroot\DotNetNuke\DesktopModules\proma.Store\LatestNewsReader.ascx.vb(55): error BC30182: Type expected. ---> System.Web.HttpCompileException: D:\Inetpub\wwwroot\DotNetNuke\DesktopModules\proma.Store\LatestNewsReader.ascx.vb(55): error BC30182: Type expected. at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---
I have been using EntitySpaces for around a year now, so I am not new to this environment. I have other tables in the DotNetNuke database which work perfectly. This problem seems to be unique to the Announcements table (as supplied from the DNN core). For example, if I substitute Announcements with my table in the example below, it works just fine. An example of the entity spaces interface code follows.
Code:
If Not Null.IsNull(ItemID) Then
With New Announcements
.es.Connection.Name = "SQL_DNN"
If .LoadByPrimaryKey(ItemID) Then
lblTitle.Text = .Title
lblContent.Text = .Description
End If
End With
End If