Home Page Icon
Home Page
Table of Contents for
4. Tuning and Debugging
Close
4. Tuning and Debugging
by Jim Buyens
Web Database Development Step by Step .NET Edition, Second Edition
Web Database Development Step by Step .Net Edition
A Note Regarding Supplemental Files
Acknowledgments
Introduction
How This Book Is Organized
Microsoft Press Support
1. Introducing Web Database Pages
1. Getting Started with Web Databases
Selecting Server-Side Tools
Upgrading from ASP to ASP.NET
Preparing Your Environment
Creating a Simple Web Database Display
Create a new ASP.NET file
Add code to read the database and write corresponding HTML
Copy the Web page and the database onto the Web server
Run the page and view the results
What’s Next?
Summary
2. Key Concepts
2. Organizing Your Web Environment
Setting Up a Development Environment on Your Own Computer
Installing a Microsoft Web Server
Install Internet Information Services
Installing Other Services
Installing the .NET Framework
Configuring Your Web Server
Creating Executable Folders
Create an executable directory
Creating a Web Server Application
Create an IIS application
Configuring ASP.NET Applications
Create a simple web.config file
Configuring Additional Web Server Settings
Assign an interpreter to a filename extension
Assign MIME types
Managing Security for Web Pages in Windows 2000 and Windows XP
Finding a Suitable Web Presence Provider
Summary
3. Introducing ASP.NET
Understanding the ASP.NET Life Cycle
Coding ASP.NET Elements
Defining Code Declaration Blocks
Defining Code Render Blocks
Understanding the Page Object
Using Page Object Events
Using Page Object Methods
Using Page Object Properties
Using the Cookies collection
Using the Request Object
Using the Response Object
Using the Server Object
Inserting Server-Side Comments
Using Server-Side Includes
Coding Common ASP.NET Directives
Coding the @ Page Directive
Coding @ Import Directives
Coding Advanced ASP.NET Directives
Coding the @ OutputCache Directive
Coding the @ Control Directive
Coding the @ Implements Directive
Coding the @ Register Directive
Coding the @ Assembly Directive
Coding the @ Reference Directive
Demonstrate ASP.NET page events
Summary
4. Introducing Web Forms
Reviewing Form Fundamentals
Improving the Forms Model with ASP.NET
Creating Web Forms
Coding HTML Server Controls
Working with HTML Server Control Attributes
Retrieving HTML Server Control Form Field Values
Create a Web page that uses HTML server controls
Coding Web Server Controls
Responding to Web Form Events
Create a Web page using Web server controls
Code event handlers that respond to Web form events
Preserving Form Data Between Submissions
Keep a count of a Web form’s postbacks
Coding Validation Server Controls
Validate the year in a TextBox control
Using Web Forms Effectively
Performance
Event Arguments
Delayed Change Events
Event Bubbling
Responding to Both Client and Server Events in HTML Server Controls
Summary
5. Introducing Visual Basic .NET
Coding Visual Basic .NET Statements
Using Visual Basic Data Types
Using Literals and Constants
Using Operators
Using Arithmetic Operators
Using Assignment Operators
Using Comparison Operators
Concatenating Strings
Using Logical Operators
Using Miscellaneous Operators
Manipulating Dates
Manipulating Strings
Working with Arrays
Using Collections
Accessing Objects
Coding Logic Statements
Writing Loops
Defining Subroutines, Functions, and Classes
Handling Errors
Create a simple but bomb-proof calculator
Summary
6. Understanding Database Concepts and Terms
The Nature of Relational Databases
Designing a Database
Informal Database Design
Identify the major entities in the application
Create a table for each major entity
Choose a key for each major entity
Add entity attributes to each major entity table
Create additional tables for repeating attributes
Make sure each field is truly an attribute of the primary key
Review the relationships among the tables
Formal Database Design
Implementing a Database Design in Access 2002
Create a blank database
Create a new table
Add data to the new table
Document relationships among tables
Create a query
Create a parameter query
SQL Concepts and Syntax
Understanding the SELECT Statement
Understanding the FROM Clause
Understanding the WHERE Clause
Understanding the GROUP BY Clause
Understanding the HAVING Clause
Understanding the ORDER BY Clause
Understanding the DELETE Statement
Understanding the INSERT Statement
Understanding the UPDATE Statement
Let Access create your SQL statements
Summary
7. Accessing Databases with ADO.NET
Introducing ADO.NET
Opening and Closing ADO.NET Connections
Using the Command Objects
Design a page that adds records to the members table
Write code that adds records to the members table
Using Data Readers
Using Stored Procedures
Using the DataAdapter, DataSet, and DataTable Objects
Use a DataAdapter to insert four AutoNumbered records
Get the AutoNumber values Access assigns to new table rows
Using DataView and DataRelation Objects
Managing Transactions
Summary
3. Developing Applications
8. Accessing the File System and Graphics
Introducing .NET File Processing Objects
Building a Zero-Maintenance Picture Gallery
Understanding the Picture Gallery Frameset
Creating Thumbnail Pictures
Create an ASP.NET page that delivers thumbnail pictures
Building the Thumbnail Page
Generate a list of folders
Code a Repeater that displays the list of folders
Create a subroutine that handles folder selections
Generate the list of thumbnails
Sort the list of thumbnail pictures
Display the list of thumbnail pictures
Summary
9. Creating Custom Components
Using Assemblies
Creating User Controls
Creating a Page Banner User Control
Create a page that displays a user control
Create a user control that displays a page banner
Creating a Cascading List User Control
Create the drop-down list controls
Load the drop-down lists with data
Create properties for reading the drop-down list values
Testing the User Controls
Test the selcat user control
Summary
10. Running Database Queries
Creating Customized DataGrids
Creating an Interactive Query that Uses a DataGrid
Create a Web page for the query
Code an event handler that runs a database query
Create a DataGrid that uses custom formatting
Code an onSortCommand event handler
Save and test the page
Creating Simple Query Pages
Create a simple query that displays detailed information
Summary
11. Identifying Sessions and Visitors
Using the Session and Application Objects
Configure the global.asax file to deliver Session variables
Use Session variables in multiple Web pages
Create a home page that displays the visitor’s computer name
Identifying Visitors
Activate forms-based authentication
Create a logon page that supports forms-based authentication
Code an event handler to process the login request
Summary
12. Updating Databases
Sending E-Mail from a Web Page
Registering a New Visitor
Create a new application
Create a visitor self-registration page
Add the ability to send e-mail
Add validation controls to the registration page
Confirming Self-Registrations
Create a page that confirms self-registrations
Posting a New Ad
Design a page that posts a new ad
Write code that posts a new ad
Summary
13. Handling File Uploads and Pictures
Processing Uploaded Files
Developing a Picture Upload Page
Create a new application
Create a picture upload page
Check security and display existing ad information
Verify and save an uploaded ad picture
Add a link from the Post a New Ad page to the Upload Picture page
Linking to the Upload Picture Page
Summary
14. Creating and Consuming Web Services
Understanding Web Services
Calling Local Classes
Calling Classes from Source Code Assemblies
Calling Classes from Compiled Assemblies
Calling Classes as Web Services
Create a coinflip Web service
Create a client for the coinflip Web service
Implementing a Contoso Classified Web Service
Create a Contoso Classified Web service
Create a proxy class for the Contoso Classified Web service
Create a client for the Contoso Classified Web service
Locating Web Services
Summary
4. Tuning and Debugging
15. Tuning and Debugging Applications
Monitoring ASP.NET Application Performance
Achieving Performance Objectives
Tuning Your Program Code
Avoid retrieving the same data more than once
Use Response.Write for string concatenation
Port call-intensive COM components to managed code
Avoid redimensioning arrays
Don’t rely on exceptions in your code
Use early binding
Tuning ASP.NET Usage
Be sure to disable debug and trace modes
Preload the Application object with useful data
Use Page.IsPostback to avoid unnecessary processing
Use server controls appropriately
Save the ViewState only when necessary
Disable the session state when you aren’t using it
Choose your session state provider carefully
Cache data and page output whenever possible
Avoid unnecessary round trips to the server
Tuning Database Usage
Design your database for efficiency
Optimize your queries
Use SQL Server for data access
Use the DataReader classes for a fast forward-only data cursor
Use stored procedures and stored queries
Avoid storing binary data in the database
Create useful indexes
General Debugging Tips
Verify the ASP.NET environment
Test early and test often
Write trace messages
Write event log messages
Debugging with Microsoft CLR Debugger
Debug an ASP.NET page interactively
Summary
Author Biography
Contacting the Author
Index
About the Author
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
14. Creating and Consuming Web Services
Next
Next Chapter
15. Tuning and Debugging Applications
Part 4. Tuning and Debugging
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset