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.