ASPAlliance.com : The #1 Active Server Pages .NET Community The #1 ASP.NET Community
Search   Search

Subscribe   Subscribe

Powered by ORCSWeb Hosting


Site Stats


Powered By ASP.NET
 
Featured Sponsor

Featured Columnist


Featured Book
.NET Common Language Runtime Unleashed
.NET Common Language Runtime Unleashed

Find Prices
Sample Chapter


New! asp.netPRO

We publish our articles in the standard RSS format.

Powerful .NET Email Component

Code Sharing Software

Welcome to DAL Helper - UPDATED 11/26/2001

Click here to return to my article index

The DAL Helper is a utility application that generates Data Access Layer (DAL) functions from stored procedures in a SQL Server database. The only characteristic of the stored procedure that the application does not automagically detect is whether or not information is returned. So, if the stored procedure does not return a result set then you must manually select the 'INSERT/UPDATE/DELETE' radiobutton and hit the 'Update Code' button.

HUGE thanks to Dave W. (#1 ASP.NET Index Site) and Steve Smith (ASP.NET/C# Trainer Extraordinaire) for bug fix contributions!

The following modifications have been made to the DAL Helper Utility:

  • 7/25/2001 - Bug: Code in Pmaker function call was missing a comma - FIXED
  • 7/25/2001 - Bug: Some stored procedures caused app to bomb out (Parsing is now uses regular expressions) - FIXED
  • 7/25/2001 - Feature: Users can now specify seperate connection string for code and database
  • 7/25/2001 - Feature: Stored procedures are now sorted alphabetically
  • 7/25/2001 - Feature: Parameters of types Integer, Money, etc. now use default lengths
  • 8/22/2001 - Bug: GlobalDBConnection was mispelled in Page_Load
  • 8/22/2001 - Bug: @objName was replaced with @objname - Systems using binary sort rejected @objName because binary sort machines are case sensitive. Thanks to Rob Meronek (www.SkateParkOfTampa.com) for educating me on this one!!!
  • 11/25/2001 - *Bug: Input textboxes were generated for Output parameters - Added check
  • 11/25/2001 - *Bug: Added Dave Wanta's (http://www.123aspx.com) regex fix for parsing
  • 11/25/2001 - *Bug: Added Steve Smith's (http://aspsmith.com) comma parsing fix
  • 11/25/2001 - *Bug: Addes support for stored procs generated by SQL Server's Stored Procedure wizard
  • 11/25/2001 - *Feature: Added default value support for parameters

All code that is generated is Beta 2/Release Candidate 0 compliant and you can use Steve Smith's pMaker function to make the parameter code more efficient.

The source code for this application can be found here. Follow these steps to setup the DAL Helper on your system:
1) Place the contents of DALHelper.txt in a .aspx file
2) Modify the GlobalDBConnection variable (connection string) to point at the database you wish to use to build the DAL functions
3) Call up the newly created .aspx page in a browser and pick a stored procedure to generate a DAL function

Feel free to make modifications to this code (send me a copy so I can use your neat features =)! Please send any bugs to me.



Enter a database connection string below. Because you are connecting to your database over the Internet you will need to enter a connection similar to this:

Data Source=192.168.0.1; uid=sa; pwd=test; Initial Catalog=pubs
or
Data Source=mysqlserver.mywebsite.com; uid=sa; pwd=test; Initial Catalog=pubs
Connection:


 Copyright © 2000-2003 ASPAlliance.com  Page Rendered at 9/7/2008 9:36:59 AM