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
4/30/2011 1:21 AM
 

                Hi,

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 the SQL tables need to be added manually and they need 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

 
New Post
4/30/2011 3:51 AM
 
you need to create your sqldataprovider files manually and package it with your module (following naming conventions) to get it run automatically upon module installation. check out the modules packaged with DNN, how to achieve this properly, www.adefwebserver.com has some tutorials as well.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
4/30/2011 10:14 AM
 
Hi, thanks for the quick reply.  This was what I knew too I just didn't know how exactly to do it.  The website you included has numerous tutorials and i couldn't find the one that's pertinent to my problem.  Would you be able to provide me with step by step directions? 

Thanks,
Jelena
 
New Post
5/1/2011 11:50 PM
 
Hello,

I have a simple module that uses one table (two columns). I need to create a one click installation module package. I have read some posts and came up with a small change. I added an SQL provider file to my zip package which adds the table. I also changed the sqlconnection in the ascx.vb file to the sql connection of the new site to which I need to install the package. I understand that this is not going to be a "one click" installation with the hardcoded connection but just wanted to have it work before I tackle that issue. The installation completed on the other site but after adding it to the site the module itself shows the following error. Keep in mind this is my own module, not the blog module which seems to have a bug related to this error:

Error: UserComments is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: The server tag is not well formed. ---> System.Web.HttpParseException: The server tag is not well formed. ---> System.Web.HttpException: The server tag is not well formed. at System.Web.UI.TemplateParser.ProcessError(String message) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc) at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---

This is my dnn file:

UserComments


Jelena
Corymb

jelena.hazlehurst@usa.com

The license for this package is not currently included within the installation file, please check with the vendor for full license details.











UserComments
UserComments




UserComments
0



DesktopModules/UserComments/UserComments.ascx
False

View


0








DesktopModules\UserComments

UserComments.ascx


UserComments.ascx.vb







This is my ascx file:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="UserComments.ascx.vb" Inherits="DesktopModules_UserComments_UserComments" %>
Text="Your comments are greatly appreciated">












ConnectionString="SqlConnection("data source = .\sql2008; Initial Catalog =dotnetnukedemo2; Integrated Security = True")"
SelectCommand="SELECT * FROM [dnn_usercomments]">






DataSourceID="SqlDataSource1"
style="margin-top: 19px" BorderColor="Black" BorderStyle="None"
ForeColor="Black">

SortExpression="comment" />





This is my ascx.vb file:
Imports DotNetNuke.Entities.Modules
Imports System
Imports System.Data
Imports System.Data.SqlClient
Partial Class DesktopModules_UserComments_UserComments
Inherits PortalModuleBase

Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged


End Sub



Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cn As New SqlConnection("data source = .\sql2008; Initial Catalog =dotnetnukedemo2; Integrated Security = True")
Dim comment As String
Dim commentdate As Date
Dim cmd As New SqlCommand
cmd.Connection = cn

comment = TextBox1.Text
commentdate = System.DateTime.Now

cn.Open()
cmd.Parameters.Add(New SqlParameter("Comment", comment))
cmd.Parameters.Add(New SqlParameter("Commentdate", commentdate))
cmd.CommandText = "INSERT INTO dnn_usercomments (comment, date) VALUES (@comment, @commentdate)"
cmd.ExecuteNonQuery()
cn.Close()

End Sub

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Panel1.Visible = True
Dim sqlresult As Object
Panel1.Visible = True
Dim cn As New SqlConnection("data source = .\sql2008; Initial Catalog =dotnetnukedemo2; Integrated Security = True")
Dim cmd As New SqlCommand
cmd.Connection = cn

cn.Open()
cmd.CommandText = "SELECT COUNT(*) AS RETURNCOUNT FROM dnn_usercomments"
sqlresult = cmd.ExecuteScalar
Dim count As Single = Convert.ToSingle(sqlresult)
Panel1.Height = 22 * count
cn.Close()

End Sub
End Class

This is my sqlprovider file:

/****** Object: Table [dbo].[dnn_usercomments] Script Date: 04/30/2011 20:24:45 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[dnn_usercomments](
[comment] [text] NULL,
[date] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO


 
New Post
5/1/2011 11:50 PM
 
Hello,

I have a simple module that uses one table (two columns). I need to create a one click installation module package. I have read some posts and came up with a small change. I added an SQL provider file to my zip package which adds the table. I also changed the sqlconnection in the ascx.vb file to the sql connection of the new site to which I need to install the package. I understand that this is not going to be a "one click" installation with the hardcoded connection but just wanted to have it work before I tackle that issue. The installation completed on the other site but after adding it to the site the module itself shows the following error. Keep in mind this is my own module, not the blog module which seems to have a bug related to this error:

Error: UserComments is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: The server tag is not well formed. ---> System.Web.HttpParseException: The server tag is not well formed. ---> System.Web.HttpException: The server tag is not well formed. at System.Web.UI.TemplateParser.ProcessError(String message) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc) at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---

This is my dnn file:

UserComments


Jelena
Corymb

jelena.hazlehurst@usa.com

The license for this package is not currently included within the installation file, please check with the vendor for full license details.











UserComments
UserComments




UserComments
0



DesktopModules/UserComments/UserComments.ascx
False

View


0








DesktopModules\UserComments

UserComments.ascx


UserComments.ascx.vb







This is my ascx file:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="UserComments.ascx.vb" Inherits="DesktopModules_UserComments_UserComments" %>
Text="Your comments are greatly appreciated">












ConnectionString="SqlConnection("data source = .\sql2008; Initial Catalog =dotnetnukedemo2; Integrated Security = True")"
SelectCommand="SELECT * FROM [dnn_usercomments]">






DataSourceID="SqlDataSource1"
style="margin-top: 19px" BorderColor="Black" BorderStyle="None"
ForeColor="Black">

SortExpression="comment" />





This is my ascx.vb file:
Imports DotNetNuke.Entities.Modules
Imports System
Imports System.Data
Imports System.Data.SqlClient
Partial Class DesktopModules_UserComments_UserComments
Inherits PortalModuleBase

Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged


End Sub



Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cn As New SqlConnection("data source = .\sql2008; Initial Catalog =dotnetnukedemo2; Integrated Security = True")
Dim comment As String
Dim commentdate As Date
Dim cmd As New SqlCommand
cmd.Connection = cn

comment = TextBox1.Text
commentdate = System.DateTime.Now

cn.Open()
cmd.Parameters.Add(New SqlParameter("Comment", comment))
cmd.Parameters.Add(New SqlParameter("Commentdate", commentdate))
cmd.CommandText = "INSERT INTO dnn_usercomments (comment, date) VALUES (@comment, @commentdate)"
cmd.ExecuteNonQuery()
cn.Close()

End Sub

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Panel1.Visible = True
Dim sqlresult As Object
Panel1.Visible = True
Dim cn As New SqlConnection("data source = .\sql2008; Initial Catalog =dotnetnukedemo2; Integrated Security = True")
Dim cmd As New SqlCommand
cmd.Connection = cn

cn.Open()
cmd.CommandText = "SELECT COUNT(*) AS RETURNCOUNT FROM dnn_usercomments"
sqlresult = cmd.ExecuteScalar
Dim count As Single = Convert.ToSingle(sqlresult)
Panel1.Height = 22 * count
cn.Close()

End Sub
End Class

This is my sqlprovider file:

/****** Object: Table [dbo].[dnn_usercomments] Script Date: 04/30/2011 20:24:45 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[dnn_usercomments](
[comment] [text] NULL,
[date] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

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