Complete The CodeThe steps that remain are: |
|||
In the previous step you will have opened your DotNetNuke website in the web browser at this point. | |||
Click LOGIN | |||
Log in as "host". The password (if you haven't already changed it) is also "host" | |||
Create the tables and stored proceduresClick on the HOST menu and select SQL |
|||
Paste the following script in the box:
|
|||
CREATE TABLE {databaseOwner}[{objectQualifier}ThingsForSale] ([ID] [int] IDENTITY(1,1) NOT NULL, [ModuleId] [int] NOT NULL, [UserID] [int] NULL, [Category] [nvarchar](25), [Description] [nvarchar](500), [Price] [float] NULL ) ON [PRIMARY] ALTER TABLE {databaseOwner}[{objectQualifier}ThingsForSale] ADDCONSTRAINT [PK_{objectQualifier}ThingsForSale] PRIMARY KEY CLUSTERED ([ID]) ON [PRIMARY] GO /** Create Stored Procedures **/ CREATE PROCEDURE {databaseOwner}[{objectQualifier}ThingsForSale_Delete]@ID int AS DELETE FROM {objectQualifier}ThingsForSale WHERE (ID = @ID) RETURN GO CREATE PROCEDURE {databaseOwner}[{objectQualifier}ThingsForSale_Insert]@ModuleId int, @UserID int, @Category nvarchar(25), @Description nvarchar(500), @Price float AS INSERT INTO {objectQualifier}ThingsForSale (ModuleId, UserID, Category, Description, Price) VALUES (@ModuleId,@UserID,@Category,@Description,@Price) RETURN GO CREATE PROCEDURE {databaseOwner}[{objectQualifier}ThingsForSale_SelectAll]@ModuleId int AS SELECT ID, ModuleId, UserID, Category, Description, Price FROM {objectQualifier}ThingsForSale WHERE (ModuleId = @ModuleId) ORDER BY Category RETURN GO CREATE PROCEDURE {databaseOwner}[{objectQualifier}ThingsForSale_Update]@ID int, @ModuleId int, @UserID int, @Category nvarchar(25), @Description nvarchar(500), @Price float AS UPDATE {objectQualifier}ThingsForSale SET ModuleId = @ModuleId, UserID = @UserID, Category = @Category, Description = @Description, Price = @Price WHERE (ID = @ID) RETURN |
|||
Select the "Run as Script" box and click "Execute". | |||
Watch the progress bar in your web browser because when the script has been run the text in the window will shift and then... nothing... Perhaps we will get a "completed" message some day :) | |||
We ran a SQL script that created the table and the stored procedures. You will notice that the script is written like: CREATE TABLE {databaseOwner}[{objectQualifier}ThingsForSale] rather than the normal: CREATE TABLE [dbo][ThingsForSale] The script commands "{databaseOwner}" and "{objectQualifier}" indicate that they are to be replaced by configuration settings in the web.config file. Normally "{databaseOwner}" is set to ".dbo" and "{objectQualifier}" is set to nothing (it would not have a setting). However, if alternate settings were indicated in the web.config file, those settings would be inserted into the script. You must have the "Run as Script" box checked for this replacement to happen.
|
|||
Register the module in DotNetNukeWhile logged into your DotNetNuke site as "host" in the web browser, from the menu bar select "Host". Then select "Module Definitions". |
|||
Click the black arrow that is pointing down to make the fly-out menu to appear. On that menu select "Create New Module". | |||
In the Edit Module Definitions menu:
Then click UPDATE
|
|||
Enter "ThingsForSale" for NEW DEFINITION
Then click "Add" |
|||
Next, Click "Add Control" | |||
In the Edit Module Control menu:
Then click UPDATE |
|||
In the upper left hand corner of the website, under the PAGE FUNCTIONS menu click ADD. | |||
In the PAGE MANAGEMENT menu under PAGE DETAILS:
Then click UPDATE |
|||
From the MODULE drop-down select "ThingsForSale". | |||
Then click ADD. | |||
The module will now appear. | |||
We have created a module definition and added the module to a page. | |||
The tutorial is complete. |
|||
If you find any errors or omissions please email me at webmaster@adefwebserver.com | |||
About the Author: | |||
|
|||
I am sorry but due to the volume of email I am unable to provide personal responses. You can obtain help using the DotNetNuke documentation and the DotNetNuke Forums. | |||
BACK |
|||
(C) by Michael Washington - ADefWebserver.com - Webmaster@ADefWebserver.comDotNetNuke® is a registered trademark of Perpetual Motion Interactive Systems Inc.
|
|||