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 ExtensionsModulesModulesCreating SQL module package with one click installationCreating SQL module package with one click installation
Previous
 
Next
New Post
5/2/2011 4:24 PM
 
Hi Sergey,

Thank you so much for your help.  You were on the right track with that sql connection.  Once I replaced the inner double quotes with single quotes  as you suggested the main error disappeared but the new one appeared when accessing the part of the application that uses that statement.  So I changed it to the following and everything worked.  Thanks a bunch!!!  

<p>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="data source = .\sql2008; Initial Catalog =dotnetnukedemo2; Integrated Security = True"
        SelectCommand="SELECT * FROM [dnn_usercomments]"></asp:SqlDataSource>
</p>
 
New Post
5/3/2011 2:42 AM
 
Jelena

You are welcome 

Sergey
 
New Post
5/5/2011 10:17 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:

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.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesCreating SQL module package with one click installationCreating SQL module package with one click installation


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