i have made a custom module on DNN and create its package but when i integrate it with some other DNN application i need to manually create its required database to make that module working with that site. Is it possible to create a package in a manner that it can automatically create its database when integrate it with other applications.i need one click deployment that user just need to ad that package and my module should start working..
The short answer is no. Part of deploying a DNN module is database scripts but there is also the need to deploy .ascx files and other resources for the module to use to the web server.
For info on the Module Development you might want to look here - http://www.dotnetnuke.com/Support/Documentation/DownloadableFiles/tabid/478/Default.aspx - the Module development guide ahas a bit of information on packaging your modules for use in other DNN sites.
Farrukh,
I am not sure if you are trying to create an entirely new database and associated schemas, or if you are simply adding objects (tables, sprocs, views etc) to the existing DotNetNuke database.... but...
Assuming you want to ADD to the existing database, then you can simply include the object creation scripts, in what is termed in the DNN module development world, a SQLDataProvider file.
During the installation process of your module, DotNetNuke will read the contents of these files and execute them against the DNN database, thus creating the schema required by your module.
Please note that there is a process which you must go through to make sure that these files are properly executed by DNN, as follows:
- Ensure that you include each SQLDataProvider file entry in your DNN manifest
- Make sure that you name your .SQLDataProvider file with the appropriate version prefix (i.e. if your module version in 01.00.01 then your SQLDataProvider file name should be 01.00.01.SQLDataprovider) -- DNN will install/upgrade based on a comparison of what you are already have installed VS what you are installing, and it will execute the appropriate script to bring the module up to date. I would suggest you take a look at the DotNetNuke StarterKit. This is a Visual Studio template generator and will create a entire baseline DotNetNuke module project which includes the SQLDataProvider files I discussed above.
Now, if you are trying to CREATE an entirely new database, then you should probably approach the situation a little differently. There are number of ways you can do this, and for the sake of argument, here is one:
- Create an ADMIN ONLY screen in your module (and Edit Screen).
- In this ADMIN control, you add a connection string creation process. This is so the administrator can configure the additional connection string required for this module. (You should implement basic security practices and encrypt this if you are going to store it in the DNN Settings)
- Add a button that fires your own custom data object creation process that will execute against the connection string you created in step 2.
I hope this helps with what you are trying to accomplish.
Cheers.