Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Error with my module in DNN 4.8
Previous Previous
 
Next Next
New Post 1/8/2008 10:34 AM
User is offline Michael Tobisch
34 posts
www.helferlein.com
10th Ranked


Error with my module in DNN 4.8 

Hi,

I have a module written, and it worked fine in DNN 4.7 and all preceding versions. In DNN 4.8 it throws an exception. Here is the line from my controller class where the exception happens:

ArrayList formItemArray = CBO.FillCollection(DataProvider.Instance().GetformItems(portalID, moduleID), typeof(formItemInfo));

The error is:

Invalid cast from 'System.Int32' to 'System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.

and the message is:

DotNetNuke.Services.Exceptions.PageLoadException: Invalid cast from 'System.Int32' to 'System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. ---> System.InvalidCastException: Invalid cast from 'System.Int32' to 'System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. at System.Convert.DefaultToType(IConvertible value, Type targetType, IformatProvider provider) at System.Int32.System.IConvertible.ToType(Type type, IformatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType, IformatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType) at DotNetNuke.Common.Utilities.CBO.HydrateObject(Object objObject, IDataReader dr) at DotNetNuke.Common.Utilities.CBO.CreateObject[T](IDataReader dr) at DotNetNuke.Common.Utilities.CBO.FillCollection[T](IDataReader dr) at helferlein.DNN.Modules.form.Business.formItemController.Get(Int32 portalID, Int32 moduleID) in d:\Web\dnn.local\App_Code\helferlein_form\formItemController.cs:line 71 at helferlein.DNN.Modules.form.form.Page_Load(Object sender, EventArgs e) in d:\Web\dnn.local\DesktopModules\helferlein_form\form.ascx.cs:line 149 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The IDataReader DataProvider.Instance().GetformItems(portalID, moduleID) does not throw an exception, but shows a RecordCount property of -1 - even if there are records returned from the stored procedure withe the approbriate parameters.

I also tried to change the call to the DAL by

List<formItemInfo> formItemList = CBO.FillCollection<formItemInfo>(DataProvider.Instance().GetformItems(portalID, moduleID));

Throws the same error...

Any ideas? Any help would be appreciated.

 
New Post 1/8/2008 10:44 AM
User is offline Scott Stokes
108 posts
www.adverageous.com
9th Ranked


Re: Error with my module in DNN 4.8 

 

Did you replace your old web.config with the one included in the downloaded Dotnetnuke 4.8?

I ask this, as possibly the objectQualifier in web.config may have been changed since you upgraded:

<add name="SqlDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionStringName="SiteSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="dnn_" databaseOwner="dbo" />

This can cause issues with DB-calls, depending on how your stored procedures and SQLDataprovider is setup.

You might set a breakpoint in your SQLDataprovider, and see exactly how the stored-procedure is being called:

Check to make sure the combined string DatabaseOwner & ObjectQualifier & "MedRec_Reports_Delete" = your stored proc name in your database.

 

 

SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier &

"MedRec_Reports_Delete"

, reportID)

 

 
New Post 1/9/2008 8:27 AM
User is offline Mitch Sellers
5692 posts
www.mitchelsellers.com
3rd Ranked




Re: Error with my module in DNN 4.8 

Michael,

They made changes in 4.8.0 to the way that CBO hydrates objects.  I have noticed a few others with similar issues.

I believe that an easy workaround would be for you to implement the IHydratable interface in your information object.


-Mitchel Sellers
MCITP, MCPD, MCTS
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
New Post 1/11/2008 7:48 AM
User is offline Michael Tobisch
34 posts
www.helferlein.com
10th Ranked


Re: Error with my module in DNN 4.8 

Mitch,

thanks for that tip, that was exactly what helped (even if I found out myself two days ago...).

Best wishes, Michael

 
New Post 2/20/2008 1:57 AM
User is offline onishiro
141 posts
9th Ranked


Re: Error with my module in DNN 4.8 

I'm having the same issue, but I have no clue on how to implement the IHydratable interface in my information object.

Any help on how to do that? or an example?

Thanks in advance.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Error with my module in DNN 4.8
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com
Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com
T-WORX, INC.
Professional DotNetNuke Solutions
www.t-worx.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP