Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesError in Reflecion( CBO.FillCollection) in DNNError in Reflecion( CBO.FillCollection) in DNN
Previous
 
Next
New Post
9/11/2011 7:57 AM
 
Hi All
I Have one Nullable property in Info Class
I want Fill the generic List By CBO.FillCollection
But I Can Not PerFormed this,I Read the Below Error Message :
Invalid cast from 'System.Int32' to 'System.Nullable'
pls Help me
Tanx a lot.
 
New Post
9/13/2011 7:58 PM
 
Im not sure if nullables are supported - we have our own null class to handle these situations (as it predates nullable types in .net), so you would use null.nullinteger to handle null values.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/22/2012 8:35 PM
 
Sorry for the resurrect.

I just upgraded from 5.2.2 to 5.6.2 and the cbo.fillcollection barfed for me too. I have a bunch of class objects that use DateTime? they no longer work.

Do you have a suggestion for me? I can't find null.nulldatetime or even null.nullinteger for that matter.

Cheers.
 
New Post
2/22/2012 10:24 PM
 

As far as I know I don't believe that .Net nullables are compatible with the CBO methods.As for the use of DateTime? in DNN 5.2.2 without issue but not in 5.6.2, I'm surprised as I don't recall any major changes to CBO class between those versions.

Do your module's entity classes implement IHydratable interface or are you relying completely on reflection to extract the property values from the datareader being passed to the CBO methods?

As for the Null class which Cathal mentioned, its namespace is DotNetNuke.Common.Utilities. All of its properties and methods are static (shared) ones that do not require the an object of the class to first be instantiated. Look in particular for the methods Null.SetNulXXX (i.e. Null.SetNullDateTime) to use when implementing IHydratable and Null.GetNull to use when converting DotNetNuke's null values to DbNull values in your SqlDataProvider.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/27/2012 6:03 PM
 
It is funny, I found the solution to my issue by finding an answer to a question that was posted by a previous co-worker:
http://dnnqna.com/questions/126/how-to-properly-implement-ihydratable-interface-in-dnn

He also found the frustration that the forced use of Ihydratable imposed on those that use CBO with nullable objects--> You have to always return all properties of an object or have to put if(datareader.getschematable.columns.contains("COLUMN_NAME")) checks before each property in the Fill implementation.

Often times I have large objects that, for all of their uses, do not require pulling back all of the object data each time i want some bit of information on it. Nor do I want to have to create a new object for each set of the same object data I want to pull back.

This has made the quickness at which I could develop via class object much slower.

Any idea on how I could dynamically use linq to create temorary object classes on the fly based off of column data?

I guess I will start an object that is generic and create properties on the fly each time it is hit with a datareader. But if something similar already exists that would be great.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesError in Reflecion( CBO.FillCollection) in DNNError in Reflecion( CBO.FillCollection) in DNN


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out