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 ExtensionsModulesModulesRunning custom SQL at module install timeRunning custom SQL at module install time
Previous
 
Next
New Post
4/15/2010 8:01 PM
 

I am a newbie to module development and have a couple of questions.  I've inherited responsibility for an existing custom module.  I need to modify it so that SQL scripts are run at module installation time.  These scripts must 1) modify the DNN database, and 2) modify a separate application database.

Can someone point me to a clear, concise source of information on how to achieve this?  I've been hunting around trying to find an appropriate source of information with no luck.  The module developer's guide doesn't seem to cover this.

Thanks in advance,

Kevin

 
New Post
4/15/2010 9:38 PM
Accepted Answer 

Kevin, as they say 'there are many ways to skin a cat' but lets start with some basics. SqlDataProvider files are executed during module installation time and are named by version (ie. 01.00.00.SqlDataProvider is full file name). These files are simply transact sql files with some minor additions specific to dnn (objectqualifier and database owner). They are executed based on current version of a module installed and the new version being installed (ie. module 2.0.0 version being installed, current installed version 01.00.00). What would happen when you install your 2.0.0 version, you would only have 02.00.00.SqlDataProvider file executed (which is any updates since previous data provider files, in our case this would have only been 01.00.00.SqlDataProvider). This is the basics, you can get more details specific to .SqlDataProviders and dnn module development other links later on. So to summarize your modification of the DNN and the separate application database, you would use your new version 02.00.00.SqlDataProvider file you create and it will be installed automatically by dnn when you install your module. 

One thing you probably won't find too much info on is executing in other application databases from the sqldataprovider files but it really is simple SQL permissions and object naming (ie. server.database.owner.object). Pretty much, if you name your non-DNN database objects using that full format you have to make sure the account executing the dnn database also has proper permissions in the non-DNN database (typically, this requires owner permissions). There are also other possibilities here, depending on how you are accessing the other database (using dnn sql connection string, or your own). 

As for great links online, books about DotNetNuke and module programming are available. Michael Washington, a Core Team member and also a book author, has lots of online information available about DotNetNuke which can be found @ his main website or here:http://adefwebserver.com/DotNetNukeHE.... It is outdated but it covers more than enough for what you need to do now (and applies to your situation more than his updated one he links to there).  


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
4/16/2010 1:46 AM
 

Chris,

Thanks very much for all your help.  Can I ask where in the module structure should the SqlDataProvider files be located so that the DNN installer can find them?

Kevin

 
New Post
4/16/2010 11:29 AM
 

I generally put it in the root of the zip file, although if you are using the .dnn manifest file format for DNN 5 or greater, you can specify the path to use sub-folders in the zip file. Will Strohl did a blog post for skin widget packaging which also points to some manifest file (which is the .dnn file) blogs that Charles Nurse wrote: http://www.willstrohl.com/Blog/EntryI.... Pay attention to the script blog Charles did as an example for what you are focused on now. 


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
4/16/2010 2:51 PM
 

Okay thanks.  This sounds very simple.

Now, to make it more complicated, let's say that we won't know the name of the application database until install time.  Is there a way for the user to provide it as an install parameter?

Or, alternatively, is there a way to get ahold of the DNN database name at install time?  We could then use that to determine the application db name, because we use a uniform naming convention,  (e.g. if the DNN database is called foo_dnn, we know the application database will be foo_data).

Thanks for all the help.

Kevin

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesRunning custom SQL at module install timeRunning custom SQL at module install time


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