Love it or loathe it, Microsoft has undisputed influence in the industry, and devel-opers who bury their head in the sand about its .NET initiative do themselves no favors. Enter the world of .NET with this book and:
You'll take a hands-on approach to quickly acquire essential skills for any
.NET application by building on your existing Java knowledge
You'll examine key techniques for creating desktop applications and web applications, implementing data access, exposing code through web services and remoting, interoperability with Java, and more
Without having to buy a single piece of software, you'll find out what the
.NET commotion is all about - most examples can be followed using
Notepad and the freely available command-line tools
You'll learn how to create sophisticated applications including a Smart Client
- Microsoft's desktop/web application hybrid - using a simple text editor from the ground up
You'll also discover some of the features of VS.NET, and how it facilitates the task of application development
What you need to know
This book aims to rapidly enhance your .NET skill set, leveraging your existing experience of the Java language to kickstart your .NET career. Specifically, this . book is for you if:
You wish to find out about C# and the .NET Framework
You have experience of Java development
You understand basic programming concepts
Introduction
Who Is This Book For?
What Does This Book Cover?
What Do I Need To Use This Book?
Conventions
Customer Support
How to Download Sample Code for this Book
Errata
E-mail Support
p2p.wrox.com
Why This System Offers the Best Support
Chapter 1: Platform Architecture
What is Microsoft .NET?
.NET Enterprise Servers
Microsoft .NET Smart Clients
Microsoft .NET XML Web Services
Microsoft .NET Developer Tools
XML Web Services
XML Web Services and SOAP
Building XML Web Services with .NET
WSDL, DISCO, and UDDI
The .NET Framework
Advantages of the .NET Framework
Application Reliability
New Architectural Model
Multi-language Support
New Language Features
Support for Smart Clients
Metadata Support
No Touch (XCopy) Deployment
Internal Naming
Security
Application Integration
Standardization
Improved Data Access
Debugging in Visual Studio. NET
Breakpoints
Watches
WebMatrix
The Interface
Web Matrix Features and Language Support
Design
Toolbox
Custom Controls and My Snippets
Properties
Classes Tab
Community
Coding and Development
Running an Application
Dreamweaver MX
The Interface
Documents and Templates
Features and Language Support
SharpDevelop
Templates
Summary
Chapter 3: Language Syntax
Source File Conventions
File Naming
Top-level Declarations
Top-level Declarations in Java
Top-level Declarations in CCC
Language Syntax
Primitive Data Types
Converting and Casting
Value and Reference Types
Boxing and Unboxing
Operators
The checked and unchecked Operators
The is Operator
The sizeof Operator
typeof and GetType
Flow Control
Branching Statements
Looping Statements
Class Fundamentals
Access Modifiers
The sealed Modifier
The readonly Modifier
The Main() Method
Other Methods
Passing by Reference
Using an Indeterminate Number of Parameters
Properties
Structs
Arrays in C#
The One-Dimensional Array
Initialization
Multi-Dimensional Arrays
Initialization
Jagged Arrays
The System.Array Class
Inheritance and Derived Classes
Typecasting to a Base Class
The base Keyword
Selecting Constructors
Method Overriding
Virtual Methods
Method Overriding with the new Modifier
Abstract Classes
Interfaces
Implementing Multiple Interfaces
Operator Overloading
Exceptions
Advanced C# Techniques
Indexers
Attributes
Delegates
Re-assigning Delegates
Invoking Delegates
Garbage Collection
Safe and .Unsafe Code
The unsafe Keyword
The fixed Keyword
Summary
Chapter 4: Data Access
The Structure of ADO.NET
ADO.NET Managed Providers
Connection Class
Command Class
DataReader Class
The DataAdapter Class
The DataSet Class
DataTableCollection
DataRelationColtection
Filtering and Sorting DataSets
Getting Practical
Fetching Data
Manipulating Data
Simple DataSet Example
Using Tables and Relations
Modifying Data
ADO.NET Events
Connection Events
DataAdapter Events
DataTable Events
ADO,NET Exceptions
Outputting DataSets' Content
XML
Serialization
Summary
Chapter 5: Dynamic Web Applications
Page Requests and How They Work
ASP.NET Page Events
HTML Server Controls
Web Server Controls
Validation Controls
Inline or Code-Behind?
Principles of Code Behind
ASP.NET and JSP
Summary
Chapter 6: Advanced Dynamic Web Applications
Running the Examples
Data-Bound Controls in ASP,NET
Properties
Collections
DataTables
Deleting Records
Managing Session and Application State
Session State
The mode Attribute
The cookieless Attribute
The timeout Attribute
The Shopping Cart Page
Application State
Building Custom Controls
A Basic Custom Control
A Derived Custom Control
A Composite Custom Control
Summary
Chapter 7: ASP.NET Web Services
Creating ASP.NET Web Services
Invoking a Web Service
BufferResponse
CacheDuration
Description
EnableSession
MessageName
TransactionOption
Creating an ASP.NET Web Service
Testing ASP.NET Web Services
Consuming a Web Service
Using External Web Services in .NET Clients
Web Service Chaining
Summary
Chapter 8: Windows Forms and Smart Clients
A Simple Windows Forms Application
Looking Behind the Scenes
Working with Properties
Adding a Cdntrol to the Form
Code for the Button
Layout Options for Controls
The Anchor Property
The Dock Property
Event Handling
Completing the Application
RadioButton and GroupBox
Listing Options
Capturing User Input
Building the Application
Smart Clients
Making the Assembly
Publish the Assembly
Trust the Assembly
Creating the Loader
Testing the Smart Client
Updating the Smart Client
Data-Bound Controls for WinForms
Binding to Single Elements
Binding to Multiple Elements
Summary
Chapter 9: Enterprise Components
J2EE Support for Enterprise Applications
The J2EE Platform
The J2EE Runtime infrastructure
J2EE Container Architecture
The J2EE APIs
J2EE Technologies
Component Technologies
Service Technologies
Communication Technologies
J2EE Deployment
.NET Support for Enterprise Applications
The System. EnterpriseServices Library
COM+ Overview
The Component Services Manager
Transactions
Just-in-Time Activation (JIT Activation)
Security
Object Pooling and State Management
Component Queuing
Event Support
Component Load Balancing
Putting COM+ into Practice
Writing your ServicedComponent
Configuring your Assemblies
Compiling the Application
Adding Object Pooling and JIT Activation Support
Writing the Client Application
Summary
Chapter 10: .NET Remoting
Remote Objects Architecture
RMI
.NET Remoting
Exploring .NET Remoting
The Remoting Namespace
Serialization in .NET
Marshaling Concepts
Marshal-By-Reference
Marshal-By-Value
Marshal-By-Value Versus Marshal-By-Reference
Channels
Formatters
Activation
Server-side Activation
Client-side Activation
Call Context
Leases and Sponsors
Leasing
Sponsors
Tracking and Logging
Building a Remoting Application
Delegates and Event Remoting Issues
Building the Chat Server
Configuration files
Server Application
Building the Server Assembly (Remote Server Object)
The Client Application
Summary
Chapter 11: Interoperating with Existing Code
Interoperating with Java
Microsoft Biztalk Server
Integration Using Web Services
Microsoft Visual J#
Creating a Visual J# Application
The Java Language Conversion Assistant (JLCA)
The Binary Converter Tool
A Comparison between Java, J#, and C#
Interoperating with COM
Accessing a COM Component from .NET
Runtime*Callable Wrappers
Generating Managed Metadata Using tlblmp.exe
Accessing the COM Component in C#
Late Binding and Early Binding
Releasing COM Objects from Memory
Incorporating ActiveX Controls in .NET Applications
Summary
Index