Wednesday, September 08, 2010
  Search
 
Register
Login
 
Creating a Virtual Directory in IIS
One of the first things you will need to do prior to installing DotNetNuke on a server is to create a virtual directory which will host your DotNetNuke website.  If you have full control over you...

Find this article and more in the IIS & ASP.NET category

Read This Article . . .

Dude, Where’s my web.config file? Resolve Installation DNN Error Message: BC30451: Name 'Config' is not declared
Sometimes troubleshooting DNN errors can be a royal pain. Fortunately, if you know what you're looking for installation errors are usually pretty easy to resolve. Unfortunately, if you don't know wha...

Find this article and more in the category

Read This Article . . .

How To Customize the Privacy and Terms Links on Your DotNetNuke Portal
Straight out of the box, DotNetNuke already has a lot of things covered. But, what do you do when you are ready to begin customizing your site. Sometimes, it’s not so easy to figure out how to make t...

Find this article and more in the category

Read This Article . . .

New DotNetNuke 5.0 Cambrian Package Writer for Module Developers
Attention developers! DotNetNuke 5.0 Cambrian has a nifty new tool to help developers package their modules nicely to fit with the new “Extensions” manager. Under the old Module Definitions manager, ...

Find this article and more in the category

Read This Article . . .

How to Use the DNNLabelEdit Control
 It's easy to use the DNNLabelEdit control, you know the one you mouse over and edit in place? Yeah, that one. In just a few minutes, you can begin using the control on your sites as well for full on...

Find this article and more in the Module Development category

Read This Article . . .

Converting a CSS Template To a DotNetNuke Skin
Creating DotNetNuke Skins can be a time consuming task. But, it's really not that hard and it doesn't have to be if you can use templates to help get started. Why not convert some free templates from...

Find this article and more in the category

Read This Article . . .

How to Install DotNetNuke 5.0 Cambrian and Video
 This video tutorial covers installing using the Custom installation option, with SQL Express and also an external SQL Database. Find out more about which package to download and how to kick off the ...

Find this article and more in the category

Read This Article . . .

Simple Intro to the DNN UserInfo Class
 New DNN developers often wonder how to expose information about logged in users to a custom DotNetNuke module. So, I threw together a very simple example to show how easy it is to begin using the bu...

Find this article and more in the DotNetNuke category

Read This Article . . .

DotNetNuke 5 Cambrian Extropy Skin Features and Limitations
The new DotNetNuke Extropy skin looks very cool from a distance...leaps and bounds above the old default blue skin. But, it's got some limitations you should know about upfront.

Find this article and more in the category

Read This Article . . .

Quick Check for Troubleshooting the CodeEndeavor Ajax Templates
I haven’t just installed the the template and created a module out of the box yet. However, I have come across a few things that I know to check and fix and I’m up and running in no time at all. If y...

Find this article and more in the category

Read This Article . . .

Recently Added Articles

Minimize
Article List

 

Generate a Module Data Access Layer With CodeSmith

10/28/2008 2:39:44 PM - By Briana Tarrance

Category: DotNetNuke | | Comments 0

 

 

Related Links

After you have downloaded and installed the freeware version of CodeSmith and downloaded and unzipped the UPDATED & ENHANCED templates, you'll need to import the templates into CodeSmith.

Click the Browse for Folder icon and navigate to the folder where you have unzipped the CodeSmith templates and hit OK.  A folder will be created for you in CodeSmith and named based upon the template holding folder. You can right click on the folder node to rename it whatever you want. 

 
 
To create the Controller Classes you'll need for custom module, double click on the Controller Class template. A new screen will open up as shown below. Click on the ellipses in the Source Table row to create a connection to your database where the tables for your module can be found.
 
 
In the Table Picker Screen, again click on the ellipses to create a connection to your database.
 
 
 
Click on OK and it will be displayed in your list of current connections. Once you see your connection in the window, hit Close and your database tables will be displayed to you.
 
 
 
Select a table that you want to create a controller class for and either double click or highlight and click Select. Then fill in the options on the Generator Screen and don't forget to update your namespace or you'll have to modify each class by hand. After you are satisfied with your options, click the Generate button on the bottom and you're generated code will be displayed to you in the right hand side of the window.
 
 
Click the Save icon and name your new file accordingly...and don't forget to save with the ".vb" extension.
 
 
Now, you can repeat the process with the Info Template. Then, to top it all off, you can run the Sql Stored Procedures template and CodeSmith will create the SQL file that you can distribute with your module. The template will even generate the file using the {databaseOwner}{moduleQualifier} tokens required. That's it!
 

Download Related Files Here or on the Downloads page: 

DNN 4.x Templates          Download

 

 

CodeSmith DNN DAL IHydratable Templates (VB.Net + SQL) Download

 
 
Copyright 2008 by Virtual-Essentials.com Privacy Statement    Terms Of Use