Synopses & Reviews
Teach yourself Visual C# 2005 fundamentalsone step at a time. With this practical, learn-by-doing tutorial, you get the guidance you need to start creating programs and components in C#
Discover how to: Work in the Visual Studio 2005 development environment Declare variables, call methods, and create operators Construct statements to selectively or repeatedly run your code Catch and handle exception errors Use object-oriented concepts to declare classes and objects Write destructors to clean up unneeded code and help manage resources Create reusable components, such as properties, indexers, and events Define types and parameters for generics and generalized classes Use Windows Forms to create user interfaces complete with user controls Access data sources using Microsoft ADO.NET Construct Web Forms that display large volumes of data Validate user input with Microsoft ASP.NET controls Write, test, and deploy Web services
CD features all practice exercises.
A Note Regarding the CD or DVD
The print version of this book ships with a CD or DVD. For those customers purchasing one of the digital formats in which this book is available, we are pleased to offer the CD/DVD content as a free download via OReilly Medias Digital Distribution services. To download this content, please visit OReillys web site, search for the title of this book to find its catalog page, and click on the link below the cover image (Examples, Companion Content, or Practice Files). Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to [email protected].
Synopsis
Teach yourself Visual C# 2005 fundamentals—one step at a time. With this practical, learn-by-doing tutorial, you get the guidance you need to start creating programs and components in C#!
Discover how to:
- Work in the Visual Studio 2005 development environment
- Declare variables, call methods, and create operators
- Construct statements to selectively or repeatedly run your code
- Catch and handle exception errors
- Use object-oriented concepts to declare classes and objects
- Write destructors to clean up unneeded code and help manage resources
- Create reusable components, such as properties, indexers, and events
- Define types and parameters for generics and generalized classes
- Use Windows Forms to create user interfaces complete with user controls
- Access data sources using Microsoft ADO.NET
- Construct Web Forms that display large volumes of data
- Validate user input with Microsoft ASP.NET controls
- Write, test, and deploy Web services
CD features all practice exercises.
For customers who purchase an ebook version of this title, instructions for downloading the CD files can be found in the ebook.
About the Author
John Sharp is a principal technologist at Content Master, part of CM Group Ltd, a technical authoring and consulting company. An expert on developing applications with the Microsoft .NET Framework and interoperability issues, John has produced numerous tutorials, white papers, and presentations on distributed systems, Web services, and the C# language. He is the author of several popular books, including Microsoft Windows Communication Foundation Step By Step and Microsoft Visual C# Step By Step.
Table of Contents
Acknowledgments; Introduction; Finding Your Best Starting Point in This Book; Conventions and Features in This Book; Online Companion Content; System Requirements; Installing and Using the Practice Files; Support for this Book; Part I: Introducing Microsoft Visual C# and Microsoft Visual Studio 2005; Chapter 1: Welcome to C#; Beginning Programming with the Visual Studio 2005 Environment; Writing Your First Program; Using Namespaces; Creating a Windows Forms Application; Chapter 1 Quick Reference; Chapter 2: Working with Variables, Operators, and Expressions; Understanding Statements; Using Identifiers; Identifying Keywords; Using Variables; Working with Primitive Data Types; Using Arithmetic Operators; Incrementing and Decrementing Variables; Chapter 2 Quick Reference; Chapter 3: Writing Methods and Applying Scope; Declaring Methods; Calling Methods; Applying Scope; Writing Methods; Chapter 3 Quick Reference; Chapter 4: Using Decision Statements; Declaring bool Variables; Using Boolean Operators; Using if Statements to Make Decisions; Using switch Statements; Chapter 4 Quick Reference; Chapter 5: Using Compound Assignment and Iteration Statements; Using Compound Assignment Operators; Writing while Statements; Writing for Statements; Writing do Statements; Chapter 5 Quick Reference; Chapter 6: Managing Errors and Exceptions; Coping with Errors; Trying Code and Catching Exceptions; Using Checked and Unchecked Integer Arithmetic; Throwing Exceptions; Using a finally Block; Chapter 6 Quick Reference; Part II: Understanding the C# Language; Chapter 7: Creating and Managing Classes and Objects; Understanding Classification; The Purpose of Encapsulation; Defining and Using a Class; Controlling Accessibility; Working with Constructors; Understanding static Methods and Data; Chapter 7 Quick Reference; Chapter 8: Understanding Values and References; Copying int Variables and Classes; Using ref and out Parameters; How Computer Memory is Organized; The System.Object Class; Boxing; Unboxing; Chapter 8 Quick Reference; Chapter 9: Creating Value Types with Enumerations and Structs; Working with Enumerations; Working with Structure Types; Chapter 9 Quick Reference; Chapter 10: Using Arrays and Collections; What Is an Array?; What Are Collection Classes?; Chapter 10 Quick Reference; Chapter 11: Understanding Parameter Arrays; Using Array Arguments; Chapter 11 Quick Reference; Chapter 12: Working with Inheritance; What Is Inheritance?; Using Inheritance; Creating Interfaces; Abstract Classes; Sealed Classes; Extending an Inheritance Hierarchy; Summarizing Keyword Combinations; Chapter 12 Quick Reference; Chapter 13: Using Garbage Collection and Resource Management; The Life and Times of an Object; Resource Management; Making Code Exception-Safe; Chapter 13 Quick Reference; Part III: Creating Components; Chapter 14: Implementing Properties to Access Attributes; Comparing Fields and Methods; What Are Properties?; Understanding the Property Restrictions; Declaring Interface Properties; Chapter 14 Quick Reference; Chapter 15: Using Indexers; What Is an Indexer?; Indexers in Interfaces; Using Indexers in a Windows Application; Chapter 15 Quick Reference; Chapter 16: Delegates and Events; Declaring and Using Delegates; The Automated Factory Scenario; Using Delegates; Anonymous Methods and Delegates; Enabling Notifications with Events; Declaring an Event; Subscribing to an Event; Unsubscribing from an Event; Raising an Event; Understanding GUI Events; Using Events; Chapter 16 Quick Reference; Chapter 17: Introducing Generics; The Problem with Objects; The Generics Solution; Creating a Generic Class; Creating a Generic Method; Chapter 17 Quick Reference; Chapter 18: Enumerating Collections; Enumerating the Elements in Collection; Implementing an Enumerator by Using an Iterator; Chapter 18 Quick Reference; Chapter 19: Operator Overloading; Understanding Operators; Understanding Compound Assignment; Declaring Increment and Decrement Operators; Defining Operator Pairs; Implementing an Operator; Understanding Conversion Operators; Chapter 19 Quick Reference; Part IV: Working with Windows Applications; Chapter 20: Introducing Windows Forms; Creating Your Application; Adding Controls to the Form; Publishing Events in Windows Forms; Run the Application; Chapter 20 Quick Reference; Chapter 21: Working with Menus and Dialog Boxes; Menu Guideliiiiiines and Style; Adding Menus and Processing Menu Events; Pop-Up Menus; Using Common Dialog Controls; Chapter 21 Quick Reference; Chapter 22: Performing Validation; Validating Data; An ExampleCustomer Maintenance; Chapter 22 Quick Reference; Part V: Managing Data; Chapter 23: Using a Database; Using ADO.NET Databases; Using ADO.NET Programmatically; Chapter 23 Quick Reference; Chapter 24: Working with Data Binding and DataSets; Windows Forms Controls and Data Binding; Updating a Database Using a DataSet; Chapter 24 Quick Reference; Part VI: Building Web Applications; Chapter 25: Introducing ASP.NET; Understanding the Internet as an Infrastructure; Creating Web Applications with ASP.NET; Chapter 25 Quick Reference; Chapter 26: Understanding Web Forms Validation Controls; Comparing Server and Client Validations; Chapter 26 Quick Reference; Chapter 27: Securing a Web Site and Accessing Data with Web Forms; Using the Web Forms GridView Control; Managing Security; Querying Data; Editing Data; Chapter 27 Quick Reference; Chapter 28: Creating and Using a Web Service; What Is a Web Service?; Building the ProductService Web Service; Web Services, Clients, and Proxies; Chapter 28 Quick Reference; Appendix : About the Author;