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 ExtensionsModulesModulesUsing FillCollection to read a column of stringsUsing FillCollection to read a column of strings
Previous
 
Next
New Post
2/20/2012 5:03 PM
 

Not sure if this is the correct forum but this goes towards module development:

We have stored procedure that returns a single column of strings. When we use the function like so:

public List<string> GetWords(int ModuleID){

return CBO.FillCollection<String>(DataProvider.Instance( ).GetWords( ModuleId ));

}

We get a an Error "No parameterless constructor defined for this object". We know the SP is working properly and GetWords is returning the proper data to this function...

Should we even be using this function?

 

 
New Post
2/21/2012 8:46 AM
 

The CBO class is designed to work with your custom classes and not elemental .Net classes. Since CBO calles upon SystemActivator.CreateInstance to instantiate the custom object and since CreateInstance requires the object to expose a default (parameterless) constructor, you will not be able to use CBO.FillCollection to return List<string>. As for System.String not having a default constructor, I guess that makes sense because a string is immutable. Creating a new String() instance that cannot then be filled is of no benefit.

Although you could define a wrapper class around System.String, it would be much easier to manually loop through the DataReader returned by your DataProvider's GetWords method and add the single string from each row returned to the List<string>.


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
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUsing FillCollection to read a column of stringsUsing FillCollection to read a column of strings


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