Creating stored procedures

When the Starter Kit wizard creates a module it also builds a script with a standard set of stored procedures for adding, updating, and deleting records in the table driving the new module.

There are several reasons to use stored procedures instead of directly putting the SQL in the project code. For one, stored procedures generally perform better; also the code is easier to maintain than hard-coded SQL and we benefit from the increased encapsulation. If the code is only working with database tables and records, it makes sense to leave it in the database.

In this recipe we will show how to modify the wizard-generated code to perform the actual add, update, and deletes your module needs.

Getting ready

To follow along with ...

Get DotNetNuke 5.4 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.