书上P436页
打包文件夹内会有2个 SqlDataProvider文件
1.01.00.00.SqlDataProvider
2. 模块名.SqlDataProvider
1.是放所有的数据库操作 比如 建表 PROC 函数 之类的
2.是更新DNN数据库的数据 如ModuleControls表,一个页面就加一个
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
exec {databaseOwner}[{objectQualifier}AddDesktopModule]
@ModuleName = N'Qa',
@FolderName = N'Qa',
@FriendlyName = N'Qa',
@Description = N'Qa',
@Version = N'01.00.00',
@IsPremium = 0,
@IsAdmin = 0,
@BusinessController = N'',
@SupportedFeatures = 3,
@CompatibleVersions=N'this Qa will update.',
@Dependencies=N'', --补上去的
@Permissions=N'' --补上去的
declare @DesktopModuleId int
select @DesktopModuleId = DesktopModuleId
from {databaseOwner}[{objectQualifier}DesktopModules]
where ModuleName = 'Qa'
exec {databaseOwner}[{objectQualifier}AddModuleDefinition] @DesktopModuleId,
@FriendlyName = N'Qa',
@DefaultCacheTime = 0
declare @ModuleDefID int
select @ModuleDefID = ModuleDefID
from {databaseOwner}[{objectQualifier}ModuleDefinitions]
where FriendlyName = 'Qa'
exec {databaseOwner}[{objectQualifier}AddModuleControl]
@ModuleDefID,
@ControlKey = NULL,
@ControlTitle = NULL,
@ControlSrc = N'DesktopModules/Qa/ViewQa.ascx',
@IconFile = NULL,
@ControlType = 0,
@ViewOrder = NULL,
@HelpUrl = NULL,
@SupportsPartialRendering=0 --补上去的
DNN文件示例
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
<dotnetnuke version="3.0" type="Module">
<folders>
<folder>
<name>Qa</name>
<friendlyname>Qa</friendlyname>
<foldername>Qa</foldername>
<modulename>Qa</modulename>
<description>Qa</description>
<version>01.00.00</version>
<businesscontrollerclass></businesscontrollerclass>
<modules>
<!--模块所包含的控件-->
<module>
<friendlyname>Qa</friendlyname>
<cachetime>0</cachetime>
<controls>
<control>
<src>DesktopModules/Qa/ViewQa.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
<control>
<key>Edit</key>
<title>EditQa</title>
<src>DesktopModules/Qa/EditQa.ascx</src>
<type>Edit</type>
<helpurl></helpurl>
</control>
<control>
<key>Settings</key>
<title>QaSettings</title>
<src>DesktopModules/Qa/Settings.ascx</src>
<type>Admin</type>
<helpurl></helpurl>
</control>
<control>
<key>QAList</key>
<title>QAList</title>
<src>DesktopModules/Qa/QAList.ascx</src>
<type>Edit</type>
<helpurl></helpurl>
</control>
<control>
<key>LogList</key>
<title>LogList</title>
<src>DesktopModules/Qa/LogList.ascx</src>
<type>Edit</type>
<helpurl></helpurl>
</control>
<control>
<key>EditProduct</key>
<title>EditProduct</title>
<src>DesktopModules/Qa/EditProduct.ascx</src>
<type>Edit</type>
<helpurl></helpurl>
</control>
<control>
<key>AddPro</key>
<title>AddPro</title>
<src>DesktopModules/Qa/AddPro.ascx</src>
<type>Edit</type>
<helpurl></helpurl>
</control>
<control>
<key>ReplyMsg</key>
<title>ReplyMsg</title>
<src>DesktopModules/Qa/ReplyMsg.ascx</src>
<type>Edit</type>
<helpurl></helpurl>
</control>
<control>
<key>DetailQA</key>
<title>DetailQA</title>
<src>DesktopModules/Qa/DetailQA.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
<control>
<key>DownLoadDetails</key>
<title>DownLoadDetails</title>
<src>DesktopModules/Qa/DownLoadDetails.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
<control>
<key>DownLoadList</key>
<title>DownLoadList</title>
<src>DesktopModules/Qa/DownLoadList.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
<control>
<key>MoreProduct</key>
<title>MoreProduct</title>
<src>DesktopModules/Qa/MoreProduct.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
<control>
<key>PlanDetail</key>
<title>PlanDetail</title>
<src>DesktopModules/Qa/PlanDetail.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
<control>
<key>ProductDetail</key>
<title>ProductDetail</title>
<src>DesktopModules/Qa/ProductDetail.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
</controls>
</module>
</modules>
<!--需要安装的文件清单-->
<files>
<!--程序集文件-->
<file>
<name>Qa.dll</name>
</file>
<file>
<name>AspNetPager.dll</name>
</file>
<file>
<name>ComponentArt.Web.UI.dll</name>
</file>
<file>
<name>DBauer.Web.UI.WebControls.DynamicControlsPlaceholder.dll</name>
</file>
<!--用户控件文件-->
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<file>
<name>ViewQa.ascx</name>
</file>
<file>
<name>EditQa.ascx</name>
</file>
<file>
<name>Settings.ascx</name>
</file>
<file>
<name>AddPro.ascx</name>
</file>
<file>
<name>DownLoadDetails.ascx</name>
</file>
<file>
<name>DownLoadList.ascx</name>
</file>
<file>
<name>EditProduct.ascx</name>
</file>
<file>
<name>LogList.ascx</name>
</file>
<file>
<name>MoreProduct.ascx</name>
</file>
<file>
<name>ProductDetail.ascx</name>
</file>
<file>
<name>QAList.ascx</name>
</file>
<file>
<name>ReplyMessage.ascx</name>
</file>
<file>
<name>DetailQA.ascx</name>
</file>
<file>
<name>PlanDetail.ascx</name>
</file>
<!--CSS-->
<file>
<name>module.css</name>
</file>
<!--语言包文件-->
<file>
<path>App_LocalResources</path><!--目录名-->
<name>ViewQa.ascx.resx</name>
</file>
<file>
<path>App_LocalResources</path>
<name>EditQa.ascx.resx</name>
</file>
<file>
<path>App_LocalResources</path>
<name>Settings.ascx.resx</name>
</file>
<!--图片文件
<file>
<path>images</path>
<name>new.gif</name>
</file>
-->
<!--数据库安装脚本-->
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<file>
<name>01.00.00.SqlDataProvider</name>
</file>
<!--数据库卸载脚本-->
<file>
<name>Uninstall.SqlDataProvider</name>
</file>
<!--模块各个页面添加到DB-->
<file>
<name>Qa.SqlDataProvider</name>
</file>
</files>
</folder>
</folders>
</dotnetnuke>