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.0Initialize a module - which is the best way?Initialize a module - which is the best way?
Previous
 
Next
New Post
10/12/2007 4:50 AM
 

Hello everybody,
I'm creating a C# module and I really need an advice.
In my module I have a table called MyModule_Category. The items of this table will fill a dropdownlist. Columns of MyModule_Category table are ItemId, ModuleId and Category. Users which have edit permissions for the module can add or remove the categories. But I also need to insert some categories in the table when the module is added to the page. These categories are fixed (but must be localized). dawoa in a recent post has suggest me how to do to call a method only one time, when the module is added to the page. So I've thought to do in this way:
I create a string array which contains my fixed categories and another array which will contain the corresponding localized categories. I add the categories to the resource files. When the module is added to the page I use a foreach statement to cycle the categories in the array, and for each category I call the method Localization.GetString to obtain the corresponding localized category. Then I add the localized string to the array. Then I pass the array and the moduleId to a stored procedure which insert the categories into the table.
My question is: is this way a good way? Or there is a better way?
And also: is it possible to pass an array to a stored procedure?
Please reply!

 
New Post
10/12/2007 8:05 AM
 

As there is no built-in way to pass an array to a sql stored proceedure, this is usually done by passing a comma-delimited string (CSV) , then processing the string in the stored proceedure either by splitting it into its values and adding each value to the table in a while loop or by the CSV string as the target of an IN operator in a dynamic SQL query.  A Google search should bring up some examples of how to do this.


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
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Initialize a module - which is the best way?Initialize a module - which is the best way?


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