This is the beginning of a series of Blog posts on using SubSonic with DotNetNuke.
SubSonic is perfect to help simplify module development for people starting out with DNN. It is easy to get overwhelmed with the module development tutorials showing the abstract & concrete data providers, controllers, info classes, and stored procedures.
The standard DNN Module Architecture is a lot of work!!!! But Subsonic can make it a breeze! So let's get started.
Here is a list of what we will need to get started: (this assumes that you have Visual Studio Pro or higher)
1) A DNN Installation - I usually start with the latest install package. DNN 460 was just released, so let's use that. Get it here.
- Unzip the Install package to a directory
- Set directory permissions (ASPNET/Network Service)
-
Create empty SQL database, create account as db_owner
-
Create virtual web directory, configure for ASP.NET v2, and default.aspx default document
-
Edit web.config for DB connection strings
-
Browse to http://localhost/vdir - does auto install
2) Install the latest Subsonic application from codeplex. There are excellent guides and tutorials for getting started with Subsonic. After installing subsonic be sure to watch these videos:
3) After having DNN and Subsonic installed and being sure that your DNN installtion runs okay and having watched the videos, let's add Subsonic to our web app.
- Add the Subsonic section right above the Dotnetnuke section group after the start of the configSections
<
section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/>
![CropperCapture[69].Jpg](/Portals/2/CropperCapture[69].Jpg)
-
Add the Subsonic Provider Definition - Right after the Connection string section
<SubSonicService defaultProvider="DNNDAL">
<providers>
<clear/>
<add name="DNNDAL" type="SubSonic.SqlDataProvider, SubSonic"
connectionStringName="SiteSqlServer"
generatedNamespace="DNNDAL"
stripTableText="DNNDAL_"/>
< FONT></providers>
< FONT></SubSonicService>
![CropperCapture[70].Jpg](/Portals/2/CropperCapture[70].Jpg)
4) Create a Generated Folder under the App_Code as the output directory for subcommander (sonic.exe)
5) Run the sonic exe tool - be sure to have specified a lang of VB to have it play nice with DNN, and to have the project name highlighted to be sure that sonic.exe picks up the web.config
![CropperCapture[73].Jpg](/Portals/2/CropperCapture[73].Jpg)
6) Check for errors in the output window and double check that all of the sections and providers are correct.
You should get the following results in the App_Code/Generated Folder
![CropperCapture[78].Jpg](/Portals/2/CropperCapture[78].Jpg)
7) Now to make things real easy - Just create a simple ASPX web Form and see that you get intellisence for the autogenerated namespace DNNDAL. Look at the goodness that you get for free
Please note: I made this post in a bit of a hurry and will clean it up and add additional information as I get to review it and based upon any feedback from people willing to give it a try.
Good luck and happy coding.