- •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 1—Introducing ASP.NET |
9 |
.NET runtime and generate intermediate language (IL) binary code (kind of like Java and byte code). The code generated by .NET compilers cannot be run directly on the processor because the generated code is not in machine language. During runtime, the .NET compilers convert this intermediate code to native machine code and that machine code is eventually run on the processor. Additionally, the .NET compilers also produce metadata that describes the code. The .NET runtime loads metadata information for performing different tasks like resolving method calls, loading different dependent modules, marshaling data from one component to another, and so on. Since the .NET runtime produces binary code that is later compiled, effectively any language that is CLR compliant and can generate IL code can be used to write ASP.NET applications and components.
Note
Code written using the .NET Common Language Runtime, is said to be managed code. Code that does not use this infrastructure is referred to as unmanaged code.
.NET offers many programmatic improvements and features, one of which is a new version of ActiveX Data Objects (ADO) called, not surprisingly, ADO.NET. ADO.NET provides a suite of data handling and binding facilities. The Web is an inherently disconnected environment: a Web application connects to a datasource, manipulates the data, reconnects to the datasource, and updates the data. ADO.NET has been designed to work in a disconnected fashion, which increases data sharing. Additionally, ADO.NET treats data in a very loose, multidimensional, object-oriented way through a strongly typed object model. With ADO, all data is represented in two dimensions, rows and columns. With ADO.NET these n-dimen- sional data representations of data are called datasets. Iterating through, updating, and deleting related tables in a dataset is exceptionally simple.
What Is .NET?
With .NET, Microsoft is formalizing a vision of an Internet made up of an infinite number of interoperable Web applications or services, which will operate in concert to form a global exchange network. The .NET Framework is really a strategy to tie disparate platforms and devices together, moving data around in a far more efficient manner than it is currently.
.NET is Microsoft’s platform for Web Services. Web Services allow applications to communicate and share data over the Internet, regardless of operating system or programming language. The Microsoft .NET platform includes a comprehensive family of products, built on Internet standards such as XML and HTTP, that provide facilities for developing, managing, using, and experiencing XML Web services. There are five areas where Microsoft is building the .NET platform: .NET Experiences, Clients, Services, Servers, and Tools.
.NET Experiences
.NET Experiences are XML Web services that enable you to access information across the Internet and from standalone applications. Microsoft will deliver .NET Experiences for individuals and for businesses. Some of the products that Microsoft is transitioning into .NET
Experiences are the Microsoft Network (MSN) and bCentral.
10 |
Friday Evening |
.NET Clients
.NET Clients are PCs, laptops, workstations, phones, handheld computers, Tablet PCs, game consoles, and other smart devices. All of these devices will have the ability to consume Web Services. .NET Clients use software that supports Web Services, and enable you to access your data regardless of location or type. The .NET client software Microsoft will offer includes Windows CE, Window 2000, and Windows XP. These applications will power PCs, laptops, workstations, smart phones, handheld computers, and Tablet PCs.
.NET Services
In addition to developers creating XML Web services, Microsoft is creating a core set of services that perform routine tasks and act as the backbone for developers to build upon. The first set of Web Services being built, codenamed “HailStorm,” is user-centric services focused on users, rather than devices, networks, or applications. “HailStorm” is based upon the Microsoft Passport user authentication system. With “HailStorm,” users receive relevant information, as they need it, delivered to the devices they’re using, and based on their established preferences.
.NET Servers
The .NET Servers, including the Windows 2000 server family, make up Microsoft .NET’s server infrastructure for developing, deploying, and managing Web Services. Designed with performance in mind, the .NET Servers will provide enterprises with the resources required to integrate their systems, applications, and partners via Web Services. The .NET Enterprise Servers are
SQL Server 2000 to store, retrieve, and analyze relational data.
Application Center 2000 to deploy and manage highly available and scalable Web applications.
BizTalk Server 2000 to build XML-based business processes across applications and organizations.
Commerce Server 2000 for quickly building scalable e-commerce solutions.
Content Management Server 2001 to manage content for dynamic e-business Web sites.
Exchange Server 2000 to enable messaging and collaboration.
Host Integration Server 2000 for integrating data and applications on legacy systems.
Internet Security and Acceleration Server 2000 for establishing secure, fast Internet connectivity.
Mobile Information 2001 Server to enable application support for mobile devices.
SharePoint Portal Server 2001 to publish business information.