Sams Teach Yourself ASP.NET in 21 Days, Second Edition By Chris Payne
Table of Contents
Bonus Day 22. Building a Complete Application
There seemed to be a few stored procedures that were used only once. Couldn't I put them in the ASP.NET page or business object itself?
Yes, but remember the advantages of stored procedures: speed, readability, and reusability. The first two benefits are easily used here, but the latter isn't so much. Regardless, using stored procedure names in your business objects instead of actual queries allows you to copy and paste much of the functionality when building new methods, and to change only one word, the name of the stored procedure.
How could I enhance the performance of this application?
There are several ways. The first is to find which pages and controls don't need to have their viewstate maintained, and disable them using EnableViewState=false. Additionally, you could disable session state for those pages that didn't need it. Caching the data returned from the database, as well as the page outputs, would also help increase functionality.
Don't forget to use the trace functionality (described in Day 20) to help locate trouble spots. When you know what parts of the application are causing the most slowdowns, you can address them specifically.