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 ExtensionsModulesModulesSet target database(s) at install time?Set target database(s) at install time?
Previous
 
Next
New Post
4/16/2010 6:42 PM
 

I had asked this in another thread, but thought better of it and am starting a new one.

I want to have the DNN installer run a SQL script(s) against a database other than the DNN database (an application db, to be precise).  Is there a way for the user to provide the database name as an install parameter, and access that parameter from the script?

Alternatively, is there a way to get the DNN database name at install time programmatically from within the SQL script?  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 in advance.

Kevin

 
New Post
4/17/2010 1:43 AM
 

No, there is no way for the user to pass anything in at install time. In the other thread I discussed your options for SQL execution at installation time and there are no other options available beyond what I referred you to. I am sorry this is the case but the what you are doing is not a very common (or secure) requirement. 

The only close alternative I could think of is accessing the web.config. To do this, you will need to use logic (vb or c#). There is the IUpgradeable Interface you can implement in your module, which will execute after module installation. You could then use IUpgradeable (for your version) to get the connection string info from the web.config (via core API) and manipulate it as you see fit to get your new db name. You still will need to have the ability for the SQL account DNN is executing with (which is in that connection string) to execute scripts (create tables) in the other application database though. 


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
4/18/2010 10:23 PM
 

Chris,

Thanks for the reply but your alternative suggestion left me confused.  If the IUpgradeable implementation in my module won't be run until after the module is installed, how could I possibly use it to fetch the database name for my SQL script?  The script will have already run at that point.

Can you please point me to documentation on IUpgradeable and its use?

Thanks,

Kevin

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesSet target database(s) at install time?Set target database(s) at 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