Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4582160
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:02:03+00:00 2026-05-21T21:02:03+00:00

I am new to dotnetnuke and asp.net altogether. I need to create a module

  • 0

I am new to dotnetnuke and asp.net altogether. I need to create a module package that is easy to install on a different DNN site. The problem is that SQL tables and other database objects need to be added manually. I would like them to be added automatically when the package is deployed. As I said I am new to all this and a step by step explanation would be very helpful.

Thanks,

Jelena

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:02:04+00:00Added an answer on May 21, 2026 at 9:02 pm

    O.K. I have gotten through this and would like to share with those who may be struggling still. Once you create a package you need to unzip it and edit some files. Take a look at the .dnn file in your package. There, as Hamlin pointed out, you need to add the SCRIPTS (not files) that will execute SQL scripts and create tables, stored procedures and other database objects. Here is the portion of the code I added to the dnn file. It is added to the components tag.

      <components>
         <component type="Script">
             <scripts> 
                <basePath>DesktopModules\UserComments</basePath>
                <script type="Install">
                <name>05.02.05.SqlDataProvider</name> 
                <version>05.02.05</version>
                </script>
    
                 <script type="uninstall"> 
                <name>uninstall.sqldataprovider</name> 
                <version>05.02.05</version>     
                </script>
             </scripts>
         </component>
            <component type="Module"> 
    

    There you need to put in the paths, file types, file names and versions. Then you need to create the dataprovider files you indicated in the manifest. I used the {databaseOwner} and {objectQualifier} to make sure the new database objects comply with the server they will be installed on. Those are case sensitive so be careful, otherwise you will be getting errors. Here is what my dataprovider files look like:

    05.02.05.sqldataprovider

    ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE TABLE {databaseOwner}{objectQualifier}usercomments(
        [moduleid] [int] NULL,
        [comment] [text] NULL,
        [date] [datetime] NULL
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    
    create procedure {databaseOwner}sp_viewcomments 
    @moduleid int
    AS
    BEGIN
    SET NOCOUNT ON 
        SELECT moduleid, comment, date from {objectQualifier}usercomments where   moduleid=@moduleid
    end
    go
    
    create PROCEDURE {databaseOwner}sp_usercommentsinsert 
    @moduleid int,
    @comment text,
    @commentdate datetime
    AS
    BEGIN
    SET NOCOUNT ON;
        insert into {databaseOwner}{objectQualifier}usercomments (moduleid, comment, date) values (@moduleid, @comment, @commentdate)  
    END
    go
    
    create PROCEDURE {databasOwner}sp_countcomments
    @moduleid int
    As
    begin
        SELECT count(*) from {databaseOwner}{objectQualifier}usercomments where moduleid=@moduleid
    end
    go
    

    uninstall.sqldataprovider

    DROP TABLE      {databaseOwner}{objectQualifier}usercomments 
    GO
    
    drop procedure {databaseOwner}sp_usercommentsinsert  
    GO
    
    drop procedure {databaseOwner}sp_viewcomments 
    GO
    
    drop procedure {databaseOwner}sp_countcomments 
    go
    

    Make sure that the sqlconnections are appropriate for the new site and make changes if necessary in those files that contain the connections (in my case I had them in vb ascx.vb and ascx fle). I used this code to pull the information from the web.config file and make the connection appropriate for any site.

    vb file:

     Dim cn As New SqlConnection(ConfigurationManager.ConnectionStrings("sitesqlserver").ConnectionString) 
    

    ascx file:

    ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"  
    

    Then package all the files including the new dataprovider files into a zip file and you should be good to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short version: How do I incorporate my custom ASP.NET/VB.NET stuff into a DNN site?
I'm new to asp.net mvc world. Are there any cms system based on asp.net
My team is starting a brand new ASP.NET solution which will probably become large.
I've newly started to open my eyes for ASP.Net MVC, but on the site
I had written one JS in asp.net. I had called that from body onload
New to the MVC.net scene (and .net for that matter), but seems I find
The new extensions in .Net 3.5 allow functionality to be split out from interfaces.
I'm a LOB .NET applications developer that would like to do some www consumer
I'm working on a DotNetNuke site which has both a staging and production server.
New to Maven. Ok so I used Maven to package up my project, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.