You are previewing C#: A Beginner's Tutorial.
O'Reilly logo
C#: A Beginner's Tutorial

Book Description

Designed as a beginner’s tutorial to the latest version of C#, this informative guide teaches how to use the .NET Framework. Written with clarity and readability in mind, it introduces important programming concepts and explains the process of building real-world applications. With the most comprehensive coverage possible in a book for beginners, it includes such topics as C# language syntax, object-oriented programming, working with numbers and dates, error handling, input output, generics, annotations, database access, and Windows Presentation Foundation.

Table of Contents

  1. Introduction
    1. Overview of the .NET Framework
    2. An Overview of Object-Oriented Programming
    3. About This Book
    4. Downloading and Installing the .NET Framework
    5. Choosing An IDE
    6. Downloading Program Examples
  2. Chapter 1: Your First Taste of C#
    1. Your First C# Program
    2. C# Code Conventions
    3. Summary
  3. Chapter 2: Language Fundamentals
    1. ASCII and Unicode
    2. Intrinsic Types and the Common Type System
    3. Variables
    4. Constants
    5. Literals
    6. Primitive Conversions
    7. Operators
    8. Comments
    9. Summary
  4. Chapter 3: Statements
    1. An Overview of C# Statements
    2. The if Statement
    3. The while Statement
    4. The do-while Statement
    5. The for Statement
    6. The break Statement
    7. The continue Statement
    8. The switch Statement
    9. Summary
  5. Chapter 4: Objects and Classes
    1. What Is a C# Object?
    2. C# Classes
    3. Creating Objects
    4. The null Keyword
    5. Objects in Memory
    6. C# Namespaces
    7. Encapsulation and Class Access Control
    8. The this Keyword
    9. Using Other Classes
    10. Static Members
    11. Variable Scope
    12. Method Overloading
    13. Summary
  6. Chapter 5: Core Classes
    1. System.Object
    2. System.String
    3. System.Text.StringBuilder
    4. Arrays
    5. System.Console
    6. Summary
  7. Chapter 6: Inheritance
    1. An Overview of Inheritance
    2. Accessibility
    3. Method Overriding
    4. Calling the Base Class’s Constructors
    5. Calling the Base Class’s Hidden Members
    6. Type Casting
    7. Sealed Classes
    8. The is Keyword
    9. Summary
  8. Chapter 7: Structures
    1. An Overview of Structures
    2. .NET Structures
    3. Writing A Structure
    4. Nullable Types
    5. Summary
  9. Chapter 8: Error Handling
    1. Catching Exceptions
    2. try without catch and the using Statement
    3. The System.Exception Class
    4. Throwing an Exception from a Method
    5. Final Note on Exception Handling
    6. Summary
  10. Chapter 9: Numbers and Dates
    1. Number Parsing
    2. Number Formatting
    3. The System.Math Class
    4. Working with Dates and Times
    5. Summary
  11. Chapter 10: Interfaces and Abstract Classes
    1. The Concept of Interface
    2. The Interface, Technically Speaking
    3. Implementing System.IComparable
    4. Abstract Classes
    5. Summary
  12. Chapter 11: Enumerations
    1. An Overview of Enum
    2. Enums in a Class
    3. Switching on enum
    4. Summary
  13. Chapter 12: Generics
    1. Why Generics?
    2. Introducing Generic Types
    3. Applying Restrictions
    4. Writing Generic Types
    5. Summary
  14. Chapter 13: Collections
    1. Overview
    2. The List Class
    3. The HashSet Class
    4. The Queue Class
    5. The Dictionary Class
    6. Summary
  15. Chapter 14: Input/Output
    1. File and Directory Handling and Manipulation
    2. Input/Output Streams
    3. Reading Text (Characters)
    4. Writing Text (Characters)
    5. Reading and Writing Binary Data
    6. Summary
  16. Chapter 15: Windows Presentation Foundation
    1. Overview
    2. Application and Window
    3. WPF Controls
    4. Panels and Layout
    5. Event Handling
    6. XAML
    7. Summary
  17. Chapter 16: Polymorphism
    1. Defining Polymorphism
    2. Polymorphism in Action
    3. Polymorphism in a Drawing Application
    4. Summary
  18. Chapter 17: ADO.NET
    1. Introduction to ADO.NET
    2. Five Steps to Data Access
    3. Connecting to SQL Server Example
    4. Summary
  19. Appendix 1: Visual Studio Express 2012 for Windows Desktop
    1. Hardware and Software Requirements
    2. Download and Installation
    3. Registering Visual Studio Express 2012
    4. Creating a Project
    5. Creating a Class
    6. Running a Project
  20. Appendix 2: Visual C# 2010 Express
    1. Hardware and Software Requirements
    2. Download and Installation
    3. Registering Your Visual C# 2010 Express
    4. Creating a Project
    5. Creating a Class
    6. Running a Project
  21. Appendix 3: SQL Server 2012 Express
    1. Downloading SQL Server 2012 Express
    2. Installing SQL Server 2012 Express
    3. Connecting to SQL Server and Creating A Database