- •Preface
- •Who Should Read This Book
- •Organization and Presentation
- •Contacting the Authors
- •Acknowledgments
- •Contents
- •Introduction
- •Why Microsoft .NET?
- •The Microsoft .NET Architecture
- •Internet Standards
- •The Evolution of ASP
- •The Benefits of ASP.NET
- •What Is .NET?
- •.NET Experiences
- •.NET Clients
- •.NET Services
- •.NET Servers
- •Review
- •Quiz Yourself
- •Installation Requirements
- •Installing ASP.NET and ADO.NET
- •Installing the .NET Framework SDK
- •Testing Your Installation
- •Support for .NET
- •Review
- •Quiz Yourself
- •Designing a Database
- •Normalization of Data
- •Security Considerations
- •Review
- •Quiz Yourself
- •Creating a Database
- •Creating SQL Server Tables
- •Creating a View
- •Creating a Stored Procedure
- •Creating a Trigger
- •Review
- •Quiz Yourself
- •INSERT Statements
- •DELETE Statements
- •UPDATE Statements
- •SELECT Statements
- •Review
- •Quiz Yourself
- •The XML Design Specs
- •The Structure of XML Documents
- •XML Syntax
- •XML and the .NET Framework
- •Review
- •Quiz Yourself
- •ASP.NET Events
- •Page Directives
- •Namespaces
- •Choosing a Language
- •Review
- •Quiz Yourself
- •Introducing HTML Controls
- •Using HTML controls
- •How HTML controls work
- •Intrinsic HTML controls
- •HTML Control Events
- •The Page_OnLoad event
- •Custom event handlers
- •Review
- •Quiz Yourself
- •Intrinsic Controls
- •Using intrinsic controls
- •Handling intrinsic Web control events
- •List Controls
- •Rich Controls
- •Review
- •Quiz Yourself
- •Creating a User Control
- •Adding User Control Properties
- •Writing Custom Control Methods
- •Implementing User Control Events
- •Review
- •Quiz Yourself
- •Common Aspects of Validation Controls
- •Display property
- •Type Property
- •Operator Property
- •Using Validation Controls
- •RequiredFieldValidator
- •RegularExpressionValidator
- •CompareValidator
- •RangeValidator
- •CustomValidator
- •ValidationSummaryx
- •Review
- •Quiz Yourself
- •Maintaining State Out of Process for Scalability
- •No More Cookies but Plenty of Milk!
- •Out of Process State Management
- •Review
- •Quiz Yourself
- •Introducing the Key Security Mechanisms
- •Web.config and Security
- •Special identities
- •Using request types to limit access
- •New Tricks for Forms-based Authentication
- •Using the Passport Authentication Provider
- •Review
- •Quiz Yourself
- •ASP.NET Updates to the ASP Response Model
- •Caching with ASP.NET
- •Page Output Caching
- •Absolute cache expiration
- •Sliding cache expiration
- •Fragment Caching
- •Page Data Caching
- •Expiration
- •File and Key Dependency and Scavenging
- •Review
- •Quiz Yourself
- •A Brief History of Microsoft Data Access
- •Differences between ADO and ADO.NET
- •Transmission formats
- •Connected versus disconnected datasets
- •COM marshaling versus text-based data transmission
- •Variant versus strongly typed data
- •Data schema
- •ADO.NET Managed Provider Versus SQL Managed Provider
- •Review
- •Quiz Yourself
- •Review
- •Quiz Yourself
- •Creating a Connection
- •Opening a Connection
- •Using Transactions
- •Review
- •Quiz Yourself
- •Building a Command
- •Connection property
- •CommandText property
- •CommandType property
- •CommandTimeout property
- •Appending parameters
- •Executing a Command
- •ExecuteNonQuery method
- •Prepare method
- •ExecuteReader method
- •Review
- •Quiz Yourself
- •Introducing DataReaders
- •Using DataReader Properties
- •Item property
- •FieldCount property
- •IsClosed property
- •RecordsAffected property
- •Using DataReader Methods
- •Read method
- •GetValue method
- •Get[Data Type] methods
- •GetOrdinal method
- •GetName method
- •Close method
- •Review
- •Quiz Yourself
- •Constructing a DataAdapter Object
- •SelectCommand property
- •UpdateCommand, DeleteCommand, and InsertCommand properties
- •Fill method
- •Update method
- •Dispose method
- •Using DataSet Objects
- •DataSetName property
- •CaseSensitive property
- •Review
- •Quiz Yourself
- •Constructing a DataSet
- •Tables property
- •TablesCollection Object
- •Count property
- •Item property
- •Contains method
- •CanRemove method
- •Remove method
- •Add method
- •DataTable Objects
- •CaseSensitive property
- •ChildRelations property
- •Columns property
- •Constraints property
- •DataSet property
- •DefaultView property
- •ParentRelations property
- •PrimaryKey property
- •Rows property
- •Dispose method
- •NewRow method
- •Review
- •Quiz Yourself
- •What Is Data Binding?
- •Binding to Arrays and Extended Object Types
- •Binding to Database Data
- •Binding to XML
- •TreeView Control
- •Implement the TreeView server control
- •Review
- •Quiz Yourself
- •DataGrid Control Basics
- •Binding a set of data to a DataGrid control
- •Formatting the output of a DataGrid control
- •Master/Detail Relationships with the DataGrid Control
- •Populating the Master control
- •Filtering the detail listing
- •Review
- •QUIZ YOURSELF
- •Updating Your Data
- •Handling the OnEditCommand Event
- •Handling the OnCancelCommand Event
- •Handling the OnUpdateCommand Event
- •Checking that the user input has been validated
- •Executing the update process
- •Deleting Data with the OnDeleteCommand Event
- •Sorting Columns with the DataGrid Control
- •Review
- •Quiz Yourself
- •What Is Data Shaping?
- •Why Shape Your Data?
- •DataSet Object
- •Shaping Data with the Relations Method
- •Review
- •Quiz Yourself
- •OLEDBError Object Description
- •OLEDBError Object Properties
- •OLEDBError Object Methods
- •OLEDBException Properties
- •Writing Errors to the Event Log
- •Review
- •Quiz Yourself
- •Introducing SOAP
- •Accessing Remote Data with SOAP
- •SOAP Discovery (DISCO)
- •Web Service Description Language (WSDL)
- •Using SOAP with ASP.NET
- •Review
- •Quiz Yourself
- •Developing a Web Service
- •Consuming a Web Service
- •Review
- •Quiz Yourself
- •ASP and ASP.NET Compatibility
- •Scripting language limitations
- •Rendering HTML page elements
- •Using script blocks
- •Syntax differences and language modifications
- •Running ASP Pages under Microsoft.NET
- •Using VB6 Components with ASP.NET
- •Review
- •Quiz Yourself
- •Preparing a Migration Path
- •ADO and ADO.NET Compatibility
- •Running ADO under ASP.NET
- •Early Binding ADO COM Objects in ASP.NET
- •Review
- •Quiz Yourself
- •Answers to Part Reviews
- •Friday Evening Review Answers
- •Saturday Morning Review Answers
- •Saturday Afternoon Review Answers
- •Saturday Evening Review Answers
- •Sunday Morning Review Answers
- •Sunday Afternoon Review Answers
- •What’s on the CD-ROM
- •System Requirements
- •Using the CD with Windows
- •What’s on the CD
- •The Software Directory
- •Troubleshooting
- •ADO.NET Class Descriptions
- •Coding Differences in ASP and ASP.NET
- •Retrieving a Table from a Database
- •Displaying a Table from a Database
- •Variable Declarations
- •Statements
- •Comments
- •Indexed Property Access
- •Using Arrays
- •Initializing Variables
- •If Statements
- •Case Statements
- •For Loops
- •While Loops
- •String Concatenation
- •Error Handling
- •Conversion of Variable Types
- •Index
Session 2—Setting Up .NET |
17 |
Figure 2-1 The ASP.NET QuickStart Tutorial Page
Testing Your Installation
To test your installation, you can simply begin walking through the default sample applications by running the QuickStart Tutorials discussed in the previous section. These tutorials are broken down into the categories shown in Table 2-3:
Table 2-3 QuickStart Tutorials
In This Category |
You’ll Find . . . |
Getting Started |
An introduction to ASP.NET and a summary overview of each |
|
of the core languages. We highly recommend that you review |
|
the discussion on language support here to familiarize yourself |
|
with Visual Basic .NET and C#. |
|
|
ASP.NET Web Forms |
A discussion of the fundamentals of designing pages, using |
|
server controls, accessing databases and building business |
|
objects with ASP.NET. This should be your next stop in the tour |
|
of tutorials. |
|
|
ASP.NET Web Services |
A few good examples to familiarize yourself with the concepts |
|
of creating and using Web Services. |
|
|
Continued
18 |
Friday Evening |
Table 2-3 |
Continued |
In This Category |
You’ll Find . . . |
ASP.NET Web Applications |
A cursory overview of what an ASP.NET application is, how to |
|
handle state within the application and how the global.aspx |
|
file is used. |
|
|
Cache Services |
A good overview of how all of the new caching features are |
|
handled including, output, fragment and data caching. |
|
|
Configuration |
Details about the machine.config and the Web.config files, |
|
which are critical in supporting major aspects of how your |
|
application operates from security and state maintenance |
|
to localization. |
|
|
Deployment |
A high-level overview on the benefits of the .NET Framework |
|
for deploying applications. |
|
|
Security |
A good summary of the multiple methods available to support |
|
authentication and authorization for your application and Web |
|
services. |
|
|
Localization |
Information on how to handle date/time, encoding and other |
|
format-related issues when targeting multiple languages. |
|
You’ll also find a high-level overview of using resource files |
|
to support language localization. |
|
|
Tracing |
An discussion of how the new tracing functionality can help |
|
you keep your sanity when debugging applications. |
|
|
Debugging |
The basics of the new visual debugger and how to turn |
|
debugging on for testing. |
|
|
Performance |
A high-level overview of the positive and negatives related |
|
to the in-process and out-of-process state maintenance. |
|
|
ASP to ASP.NET Migration |
The key differences in ASP and ASP.NET. This is a great starting |
|
point for those of you familiar with developing for ASP. |
|
|
Sample Applications |
Consists of several excellent sample applications, including |
|
a Personalized Portal, an E-Commerce Application, A Class |
|
Browser Application, and the best example of all the |
|
IBuySpy.com application which covers many of the most |
|
crucial elements you will need to understand such as user |
|
logins, shopping baskets, the use of n-tier development best |
|
practices, and the use of Web services. An absolute must |
|
review! |
|
|
Session 2—Setting Up .NET |
19 |
You will likely face challenges if you have previously installed beta versions of the .NET Framework SDK. If you have installed beta versions, plan to reinstall the operating system prior to installing the production version. Even though the beta versions were fairly stable, anytime you try and simply install production bits over beta bits you are likely to create problems.
Support for .NET
There are a tremendous number of newsgroups and knowledge base articles available on-line to support your development efforts. In order to help you identify some of the more popular support groups available on-line that are specific to ASP.NET and ADO.NET, please refer to Table 2-4.
Table 2-4 Support Resources for ASP.NET and ADO.NET
Name |
Type of Support |
URL |
MSDN Online Newsgroups |
Newsgroup |
http://msdn.microsoft.com/newsgroups/ |
|
|
|
ASP.NET Homepage |
Web Site |
http://www.asp.net/ |
|
|
|
Cold Rooster Consulting |
Web Site |
http://www.coldrooster.com/default.asp |
|
|
|
ASPNG Discussion Lists |
Discussion List |
http://www.aspng.com/aspng/index.aspx |
|
|
|
IBuySpy Homepage |
Web Site |
http://www.ibuyspy.com/ |
|
|
|
GotDotNet |
Web Site |
http://www.gotdotnet.com |
|
|
|
REVIEW
You should now be on your way to developing! If you run into issues, be sure to check http://msdn.microsoft.com and http://support.microsoft.com for additional troubleshooting tips.
QUIZ YOURSELF
1.What are the minimal requirements for installing the .NET Framework? (See “Installation Requirements.”)
2.Can you successfully use the .NET Framework on Windows 95? (See “Installation Requirements.”)
3.List two on-line resources that provide support on ASP.NET or ADO.NET?
(See “Support for .NET.”)