Sunday, September 05, 2010
  Search
 
Register
Login
 
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 . . .

SERIES: Anatomy of a DNN Web.Config File-connectionStrings
The section holds all the necessary information for database communication from your website. At minimum, there will be at least one connection string for any DotNetNuke website...

Find this article and more in the category

Read This Article . . .

CodePrint Module
Tired of mucking around with adding code chunks to your website? We all know what a pain it can be trying to add some simple block of code to our webpages and still make it readable. Introducing....T...

Find this article and more in the DotNetNuke 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 . . .

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 . . .

Creating new DotNetNuke HTTP Alias Records
 Setting up DotNetNuke to handle serving requests for Portal Alias records is a breeze. You can use these records to direct your site to handle requests for multiple domain names to one website with ...

Find this article and more in the category

Read This Article . . .

Getting Aquainted with the DNN Classes
 So, you've decided to start checking out DotNetNuke development and you're wondering where to start, right? Well, it's easy to start taking a quick tour of the DotNetNuke classes now with the help o...

Find this article and more in the 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 . . .

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 . . .

Using DNN to take Advantage of GoDaddy Domain Names
Let's face it, GoDaddy is cheap. Pay for the hosting services and the domain names are $1.99, not a bad deal. And even without hosting services, you can pick up domain names for as low as $6.99. Put ...

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