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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Storing more complex module settingsStoring more complex module settings
Previous
 
Next
New Post
1/27/2009 12:29 PM
 

Hi,

Is there a way of handling more complex module settings then key value pairs? Is it a case of adding your own custom table(s), then developing your settings control in much the same way, except that you retrieve the settings from and save settings to your custom table(s)? As long as you give your control that retrieves and saves all the settings the key value 'Settings' when defining your module, then DNN will handle displaying it on the Module Settings page? I wish to record module settings that each have a number of different attributes - think of a table with multiple columns in the Module Settings page with the ability to add and remove rows.

Thanks,

Norman

 
New Post
1/27/2009 1:02 PM
 

Norman,

is the data you wish to store able to be stored in a string field, or is it some type of binary or image data that you are wanting to store?  The reason I ask is because if it's just a bunch of properties for an object you are creating, you could just serialize your object and store the data in a single setting value.  Could you give us a little more detail about what you are trying to accomplish specifically?

 
New Post
1/28/2009 10:15 AM
 

Hi Jay,

I guess it's the type of data you could store in a string field. However I have a numbr of concerns - just thinking out load. Isn't there a limit though to how much you can store in the settings field? Also, it might make it difficult to edit stuff directly in the database if ever needed to? Also it wouldn't allow me to maintain referential integrity if these objects were related to other objects in the database (for example if the object id was related to an id in another physical table). I'd be interested to know more though.

 
New Post
1/28/2009 1:49 PM
 

Norman,

You're right, there is a limit to what can be stored for a setting.  Each setting value is NVARCHAR (2000) so it can store up to 2000 characters before truncation occurs (and the name setting is limited to 50 characters).

What I've done in the past when I have had similar requirements as you do is to create my own settings table for my modules.  In that regard I can specifically create any data types and lengths that I need; some cases I use TEXT fields (which you can't edit directly in the database table anyway), other cases I use numeric types, etc.  The caveat is that I can't use the ModuleSettings controller for it, of course, but have to write my own code and stored procs to handle it.  On that same token, when I've done the approach mentioned I tend to have my Settings control completely separate from the standard module settings control (instead of using the key "Settings" I have my own) because those pages tend to get complicated.

Additionally -- yes, storing your data as a string when the ID is related to another object in your database would affect referential integrity.  That is one of the sacrifices you might make in lieu of ease and less code.  There are always architectual decisions to be made regarding your modules, that is definitely one of them.

Hope that answers your questions?


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
1/30/2009 7:08 AM
 

It certainly does - thanks again Jon

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Storing more complex module settingsStoring more complex module settings


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