Jim Bonnie's Blog

Sep 20

Written by: jbonnie
Thursday, September 20, 2007 9:58:01 PM 

There are a few set-up steps that are required to create a class library and seperate DLL for a SubSonic Data Access Layer. To help avoid these repetitive steps I have created a Visual Studio 2005 project that can be re-used.

There are a few set-up steps that are required to create a class library and seperate DLL for a SubSonic Data Access Layer. To help avoid these repetitive steps I have created a Visual Studio 2005 project that can be re-used.

Rob Conery goes through the steps for setting up a class library project here.

In addition to the steps Rob shows in the video I have included a few other files as shown below.

ddndal project files.Jpg

There is a ss.config file that  can used to specify your connection string and subsonic build provider parameters. Here I have two connection strings, and specify the INVENTORY connection. Other parameters can be specified to tailor the files generated.

config file.Jpg

There is a also a ss.bat file that can run from the command line to run the generator and create the DAL files. The files are created in the Generated folder. The Batch file assumes that subsonic is installed in the c:\program files\ directory and can be changed.

Here is an example of the output from running the ss.bat file.

batch file output.Jpg

After the DAL files are created in the Generated Folder, Visual Studio does not automatically include them in the project as shown. You must select the files and right click/include in Project.

include files.Jpg

Now, when you build the project, the created DLL will have your Data Access Layer, and this DLL can be referenced in your DNN modules or any other .net project.

The project is available on the downloads page, Be sure to clean up the generated folder, and do not use my secret password :)

 

 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 

Navigation

Register Login

About Me

Thanks for stopping by. My name is Jim Bonnie and I have been writing software for over 20 years. After building financial data systems for Reuters for nearly 18 years I have started doing contract work and am excited about technology and currently focus on Microsoft solutions. DotNetNuke has helped provide a good introduction to ASP.NET web application development, and I am now starting to branch out into other areas. Data Access techniques and SubSonic is something that I am looking into now. This has helped me get an invitation to speak at Las Vegas at DNN Open Force 07. it was a great time. And I am looking forward to OpenForce08, where I wil be presenting on TDD for DNN.

 

Reading the codebetter blogs and attending a nothing but .net training class with JP Boodhoo helped spark my interest in ALT.NET. I attended the first conference in Austin Texas, and it was amazing to see Scott Guthrie introduce the ASP.NET MVC framework.

Add to Technorati Favorites

View blog top tags

Links

Jim Bonnie's Blog

Jim Bonnie's Blog

Jim Bonnie's Blog