DNN Blog

Jun 24

Posted by: Michael Washington
6/24/2006  RssIcon

I just updated the module developers guide to provide some detail on the DAL+. Currently the most detailed description is available in my latest tutorial. I am working on updating the entire module developers guide and plan to have that complete by October.

The following is a section that appears after an explanation of the current "traditional DAL".

Using the DAL+

An alternative to the data access layer (the DAL) described above is the DAL+.  The DAL+ is only available for DotNetNuke 4.3 or higher (or DotNetNuke 3.3 or higher). The DAL+ is an alternative method of communicating with the database. This method will still allow you to communicate with an alternate database.

However, unlike the traditional DAL that was previously described, the DAL+ is not 100% "portable" to other data sources. It's is best used for modules that will not be distributed to other DotNetNuke sites that run on a database other than the database you develop the module on. For those situations it is best to use the traditional DAL described above.

The purpose of the DAL+ is to simplify module development by a reduction in code and complexity. The DAL+ allows you to make “calls” to the database directly from the “controller” class. Meaning, you do not have to code a separate data provider. Using the DAL+ you would not need to code the SQLDataProvider class described above.

The DAL+ achieves this by providing the following generic methods:

  • ExecuteNonQuery - Used to execute a stored procedure or sql statement that will not return a value.
  • ExecuteReader - Used to execute a stored procedure or sql statement that will return multiple records.
  • ExecuteScalar - Used to execute a stored procedure or sql statement that will return a single value.

Below is an explanation of the format used to implement the DAL+. The ExecuteReader method is used in the example to “call” a stored procedure named "ThingsForSale_SelectAll:

This will allow a module developer to use code such as:

Private Function GetItems(ByVal ModuleId As Integer) As ArrayList

          Return CBO.FillCollection(DataProvider.Instance().ExecuteReader("GetItems",ModuleId), GetType(ItemInfo))

Private Function

The generic methods will exist in all the concrete data providers that support DotNetNuke 4.3 or higher.

Tags:
Categories:
Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft .NET. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates Snowcovered.com where users purchase third party apps for the platform.