digg.png delicious.png blinkit.png furl.png

1 Introduction to Computers, the Internet and Visual Basic

1.1 Introduction

1.2 What Is a Computer?

1.3 Computer Organization

1.4 Early Operating Systems

1.5 Personal Computing, Distributed Computing and Client/Server Computing

1.6 Hardware Trends

1.7 Microsoft's Windows® Operating System

1.8 Machine Languages, Assembly Languages and High-Level Languages

1.9 Visual Basic

1.10 C, C++, Java and Visual C#

1.11 Other High-Level Languages

1.12 The Internet and the World Wide Web

1.13 Extensible Markup Language (XML)

1.14 Microsoft's .NET

1.15 The .NET Framework and the Common Language Runtime

1.16 Test-Driving a Visual Basic Application

1.17 (Only Required Section of the Case Study) Software Engineering Case Study: Introduction to Object Technology and the UML

1.18 Wrap-Up

1.19 Web Resources

2 Introduction to the Visual Basic Express 2005 IDE

2.1 Introduction

2.2 Overview of the Visual Studio 2005 IDE

2.3 Menu Bar and Toolbar

2.4 Navigating the Visual Studio IDE

2.4.1 Solution Explorer

2.4.2 Toolbox

2.4.3 Properties Window

2.5 Using Help

2.6 Using Visual Programming to Create a Simple Program that
Displays Text and an Image

2.7 Wrap-Up

2.8 Web Resources

3 Introduction to Visual Basic Programming

3.1 Introduction

3.2 Displaying a Line of Text

3.3 Creating Your First Console Application in Visual Basic Express

3.4 Displaying a Single Line of Text with Multiple Statements

3.5 Adding Integers

3.6 Memory Concepts

3.7 Arithmetic

3.8 Decision Making: Equality and Relational Operators

3.9 Using a Message Dialog to Display a Message

3.10 (Optional) Software Engineering Case Study: Examining
the ATM Requirements Document

3.11 Wrap-Up

3.12 Web Resources

4 Introduction to Classes and Objects

4.1 Introduction

4.2 Classes, Objects, Methods and Instance Variables

4.3 Declaring a Class with a Method and Instantiating an Object of a Class

4.4 Declaring a Method with a Parameter

4.5 Instance Variables and Properties

4.6 Value Types and Reference Types

4.7 Initializing Objects with Constructors

4.8 Validating Data with Set Accessors in Properties

4.9 (Optional) Software Engineering Case Study: Identifying the Classes in the ATM Requirements Document

4.10 Wrap-Up

5 Control Statements: Part 1

5.1 Introduction

5.2 Algorithms

5.3 Pseudocode

5.4 Control Structures

5.5 If Then Selection Statement

5.6 If Then Else Selection Statement

5.7 While Repetition Statement

5.8 Do While Loop Repetition Statement

5.9 Do Until Loop Repetition Statement

5.10 Compound Assignment Operators

5.11 Formulating Algorithms: Case Study 1 (GradeBook with Counter-Controlled Repetition)

5.12 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (GradeBook with Sentinel-Controlled Repetition)

5.13 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Statements)

5.14 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 4 (Nested Repetition Statements)

5.15 Visual Basic Programming in a Windows Application

5.16 (Optional) Software Engineering Case Study: Identifying Class Attributes in the ATM System

5.17 Wrap-Up

6 Control Statements: Part 2

6.1 Introduction

6.2 Essentials of Counter-Controlled Repetition

6.3 For Next Repetition Statement

6.4 Examples Using the For Next Statement

6.5 GradeBook Case Study: Select Case Multiple-Selection Statement

6.6 Do Loop While Repetition Statement

6.7 Do Loop Until Repetition Statement

6.8 Using the Exit Statement in Repetition Statements

6.9 Using the Continue Statement in Repetition Statements

6.10 Logical Operators

6.11 (Optional) Software Engineering Case Study: Identifying Objects' States and Activities in the ATM System

6.12 Wrap-Up

6.13 Structured Programming Summary

7 Methods: A Deeper Look

7.1 Introduction

7.2 Modules, Classes and Methods

7.3 Subroutines: Methods That Do Not Return a Value

7.4 Functions: Methods That Return a Value

7.5 Shared Methods and Class Math

7.6 GradeBook Case Study: Declaring Methods with Multiple Parameters

7.7 Notes on Declaring and Using Methods

7.8 Method Call Stack and Activation Records

7.9 Implicit Argument Conversions

7.10 Option Strict and Data-Type Conversions

7.11 Value Types and Reference Types

7.12 Framework Class Library Namespaces

7.13 Passing Arguments: Pass-by-Value vs. Pass-by-Reference

7.14 Scope of Declarations

7.15 Case Study: Random Number Generation

7.16 Case Study: A Game of Chance

7.17 Method Overloading

7.18 Optional Parameters

7.19 Recursion

7.20 (Optional) Software Engineering Case Study: Identifying Class
Operations in the ATM System

7.21 Wrap-Up

8 Arrays

8.1 Introduction

8.2 Arrays

8.3 Declaring and Allocating Arrays

8.4 Examples Using Arrays

8.4.1 Allocating an Array

8.4.2 Initializing the Values in an Array

8.4.3 Summing the Elements of an Array

8.4.4 Using Arrays to Analyze Survey Results

8.4.5 cUsing Bar Charts to Display Array Data Graphically

8.4.6 Using the Elements of an Array as Counters

8.5 Case Study: Card Shuffling and Dealing Simulation

8.6 Passing an Array to a Method

8.7 For Each Next Repetition Statement

8.8 GradeBook Case Study: Using an Array to Store Grades

8.9 Sorting an Array with Method Sort of Class Array

8.10 Searching Arrays

8.10.1 Searching an Array with Linear Search

8.10.2 Searching a Sorted Array with Method BinarySearch of
Class Array

8.11 Rectangular Arrays

8.12 GradeBook Case Study: Using a Rectangular Array

8.13 Variable-Length Parameter Lists

8.14 Jagged Arrays

8.15 Using the ReDim Statement to Change the Size of an Array at
Execution Time

8.16 Passing Arrays: ByVal vs. ByRef

8.17 (Optional) Software Engineering Case Study: Collaboration Among
Objects in the ATM System

8.18 Wrap-Up

9 Classes and Objects: A Deeper Look

9.1 Introduction

9.2 Time Class Case Study

9.3 Class Scope

9.4 Default and Parameterless Constructors

9.5 Time Class Case Study: Overloaded Constructors

9.6 Partial Classes

9.7 Composition

9.8 Using the Me Reference to Access the Current Object

9.9 Garbage Collection

9.10 Shared Class Members

9.11 Const and ReadOnly Members

9.12 Object Browser

9.13 (Optional) Software Engineering Case Study: Starting to Program the
Classes of the ATM System

9.14 Wrap-Up

10 Object-Oriented Programming: Inheritance

10.1 Introduction

10.2 Base Classes and Derived Classes

10.3 Protected Members

10.4 Relationship between Base Classes and Derived Classes

10.4.1 Creating and Using a CommissionEmployee Class

10.4.2 Creating a BasePlusCommissionEmployee Class without Using Inheritance

10.4.3 Creating a CommissionEmployee BasePlusCommissionEmployee Inheritance Hierarchy

10.4.4 CommissionEmployee BasePlusCommissionEmployee Inheritance Hierarchy Using Protected Instance Variables

10.4.5 CommissionEmployee BasePlusCommissionEmployee Inheritance Hierarchy Using Private Instance Variables

10.5 Constructors in Derived Classes

10.6 Software Engineering with Inheritance

10.7 Class Object

10.8 Friend Members

10.9 Wrap-Up

11 Object-Oriented Programming: Polymorphism

11.1 Introduction

11.2 Polymorphic Video Game

11.3 Demonstrating Polymorphic Behavior

11.4 Abstract Classes and Methods

11.5 Case Study: Payroll System Class Hierarchy Using Polymorphism

11.5.1 Creating Abstract Base Class Employee

11.5.2 Creating Concrete Derived Class SalariedEmployee

11.5.3 Creating Concrete Derived Class HourlyEmployee

11.5.4 Creating Concrete Derived Class CommissionEmployee

11.5.5 Creating Indirect Concrete Derived Class BasePlusCommissionEmployee

11.5.6 Demonstrating Polymorphic Processing, Expression TypeOf Is , TryCast and Downcasting

11.5.7 Summary of the Allowed Assignments between Base Class and Derived Class Variables

11.6 NotOverridable Methods and NotInheritable Classes

11.7 Case Study: Creating and Using Interfaces

11.7.1 Developing an IPayable Hierarchy

11.7.2 Declaring Interface IPayable

11.7.3 Creating Class Invoice

11.7.4 Modifying Class Employee to Implement Interface IPayable

11.7.5 Modifying Class SalariedEmployee for Use in the IPayable Hierarchy

11.7.6 Using Interface IPayable to Process Invoice s and Employee s Polymorphically

11.7.7 Common Interfaces of the .NET Class Library

11.8 (Optional) Software Engineering Case Study: Incorporating Inheritance and Polymorphism into the ATM System

11.9 Wrap-Up

12 Exception Handling

12.1 Introduction

12.2 Exception Handling Overview

12.3 Example: Divide by Zero Without Exception Handling

12.4 Example: Handling DivideByZeroException s and FormatException s

12.4.1 Enclosing Code in a Try Block

12.4.2 Catching Exceptions

12.4.3 Uncaught Exceptions

12.4.4 Termination Model of Exception Handling

12.4.5 Flow of Control When Exceptions Occur

12.5 .NET Exception Hierarchy

12.5.1 Classes ApplicationException and SystemException

12.5.2 Determining Which Exceptions a Method Throws

12.6 Finally Block

12.7 Exception Properties

12.8 User-Defined Exception Classes

12.9 Wrap-Up

13 Graphical User Interface Concepts: Part 1

13.1 Introduction

13.2 Windows Forms

13.3 Event Handling

13.3.1 A Simple Event-Driven GUI

13.3.2 Another Look at the Visual Studio Generated Code

13.3.3 Delegates and the Event-Handling Mechanism

13.3.4 Other Ways to Create Event Handlers

13.3.5 Locating Event Information

13.4 Control Properties and Layout

13.5 Label s, TextBox es and Button s

13.6 GroupBox es and Panel s

13.7 CheckBox es and RadioButton s

13.8 P ictureBox es

13.9 ToolTip s

13.10 NumericUpDown Control

13.11 Mouse-Event Handling

13.12 Keyboard-Event Handling

13.13 Wrap-Up

14 Graphical User Interface Concepts: Part 2

14.1 Introduction

14.2 Menus

14.3 MonthCalendar Control

14.4 DateTimePicker Control

14.5 LinkLabel Control

14.6 ListBox Control

14.7 CheckedListBox Control

14.8 ComboBox Control

14.9 TreeView Control

14.10 ListView Control

14.11 TabControl Control

14.12 Multiple Document Interface (MDI) Windows

14.13 Visual Inheritance

14.14 User-Defined Controls

14.15 Wrap-Up

15 Multithreading

15.1 Introduction

15.2 Thread States: Life Cycle of a Thread

15.3 Thread Priorities and Thread Scheduling

15.4 Creating and Executing Threads

15.5 Thread Synchronization and Class Monitor

15.6 Producer/Consumer Relationship without Thread Synchronization

15.7 Producer/Consumer Relationship with Thread Synchronization

15.8 Producer/Consumer Relationship: Circular Buffer

15.9 Multithreading with GUIs

15.10 Wrap-Up

16 Strings, Characters and Regular Expressions

16.1 Introduction

16.2 Fundamentals of Characters and Strings

16.3 String Constructors

16.4 String Indexer, Length Property and CopyTo Method

16.5 Comparing String s

16.6 Locating Characters and Substrings in String s

16.7 Extracting Substrings from String s

16.8 Concatenating String s

16.9 Miscellaneous String Methods

16.10 Class StringBuilder

16.11 Length and Capacity Properties, EnsureCapacity Method and Indexer
of Class StringBuilder

16.12 Append and AppendFormat Methods of Class StringBuilder

16.13 Insert , Remove and Replace Methods of Class StringBuilder

16.14 Char Methods

16.15 Card Shuffling and Dealing Simulation

16.16 Regular Expressions and Class

16.16.1 Regular Expression Example

16.16.2 Validating User Input with Regular Expressions

16.16.3 Regex methods Replace and Split

16.17 Wrap-Up

17 Graphics and Multimedia

17.1 Introduction

17.2 Drawing Classes and the Coordinate System

17.3 Graphics Contexts and Graphics Objects

17.4 Color Control

17.5 Font Control

17.6 Drawing Lines, Rectangles and Ovals

17.7 Drawing Arcs

17.8 Drawing Polygons and Polylines

17.9 Advanced Graphics Capabilities

17.10 Introduction to Multimedia

17.11 Loading, Displaying and Scaling Images

17.12 Animating a Series of Images

17.13 Windows Media Player

17.14 Microsoft Agent

17.15 Wrap-Up

18 Files and Streams

18.1 Introduction

18.2 Data Hierarchy

18.3 Files and Streams

18.4 My.Computer.FileSystem Object

18.5 Creating a Sequential-Access File

18.6 Reading Data from a Sequential-Access File

18.7 Wrap-Up

18.8 Random-Access Files

18.9 Creating a Random-Access File

18.10 Writing Data Randomly to a Random-Access File

18.11 Reading Data Sequentially from a Random-Access File

18.12 Case Study: A Transaction-Processing Program

18.13 Creating a Sequential-Access File

18.14 Reading Data from a Sequential-Access File

18.15 Time Class Case Study: Using Namespaces and Creating Assemblies

19 Extensible Markup Language (XML)

19.1 Introduction

19.2 XML Basics

19.3 Structuring Data

19.4 XML Namespaces

19.5 Document Type Definitions (DTDs)

19.6 W3C XML Schema Documents

19.7 (Optional) Extensible Stylesheet Language and XSL Transformations

19.8 (Optional) Document Object Model (DOM)

19.9 (Optional) Schema Validation with Class XmlReader

19.10 (Optional) XSLT with Class XslCompiledTransform

19.11 Wrap-Up

19.12 Web Resources

19.13 Microsoft BizTalk™

20 Database, SQL and ADO.NET

20.1 Introduction

20.2 Relational Databases

20.3 Relational Database Overview: Books Database

20.4 SQL

20.4.1 Basic SELECT Query

20.4.2 WHERE Clause

20.4.3 ORDER BY Clause

20.4.4 Merging Data from Multiple Tables: INNER JOIN

20.4.5 INSERT Statement

20.4.6 UPDATE Statement

20.4.7 DELETE Statement

20.5 ADO.NET Object Model

20.6 Programming with ADO.NET: Extracting Information from a Database

20.6.1 Displaying a Database Table in a DataGridView

20.6.2 How Data Binding Works

20.7 Querying the Books Database

20.8 Programming with ADO.NET: Address Book Case Study

20.9 Using a DataSet to Read and Write XML

20.10 Wrap-Up

20.11 Web Resources

21 ASP.NET, Web Forms and Web Controls

21.1 Introduction

21.2 Simple HTTP Transactions

21.3 Multitier Application Architecture

21.4 Creating and Running a Simple Web-Form Example

21.4.1 Examining an ASPX File

21.4.2 Examining a Code-Behind File

21.4.3 Relationship Between an ASPX File and a Code-Behind File

21.4.4 How the Code in an ASP.NET Web Page Executes

21.4.5 Examining the XHTML Generated by an ASP.NET Application

21.4.6 Building an ASP.NET Web Application

21.5 Web Controls

21.5.1 Text and Graphics Controls

21.5.2 AdRotator Control

21.5.3 Validation Controls

21.6 Session Tracking

21.6.1 Cookies

21.6.2 Session Tracking with HttpSessionState

21.7 Case Study: Connecting to a Database in ASP.NET

21.7.1 Building a Web Form That Displays Data from a Database

21.7.2 Modifying the Code-Behind File for the Guestbook Application

21.8 Case Study: Secure Books Database Application

21.8.1 Examining the Completed Secure Books Database Application

21.8.2 Creating the Secure Books Database Application

21.9 Wrap-Up

21.10 Web Resources

22 Web Services

22.1 Introduction

22.2 .NET Web Services Basics

22.2.1 Creating a Web Service in Visual Web Developer

22.2.2 Discovering Web Services

22.2.3 Determining a Web Service's Functionality

22.2.4 Testing a Web Service's Methods

22.2.5 Building a Client to Use a Web Service

22.3 Simple Object Access Protocol (SOAP)

22.4 Publishing and Consuming Web Services

22.4.1 Defining the HugeInteger Web Service

22.4.2 Building a Web Service in Visual Web Developer

22.4.3 Deploying the HugeInteger Web Service

22.4.4 Creating a Client to Consume the HugeInteger Web Service

22.4.5 Consuming the HugeInteger Web Service

22.5 Session Tracking in Web Services

22.5.1 Creating a Blackjack Web Service

22.5.2 Consuming the Blackjack Web Service

22.6 Using Web Forms and Web Services

22.6.1 Adding Data Components to a Web Service

22.6.2 Creating a Web Form to Interact with the Airline Reservation Web Service

22.7 User-Defined Types in Web Services

22.8 Wrap-Up

22.9 Web Resources

22.10 Global XML Web Services Architecture (GXA)

22.10.1 WS-Inspection

22.10.2 WS-Routing

22.10.3 WS-Referral

22.10.4 WS-Security

22.11 Case Study: Weather Information Application

23 Networking: Streams-Based Sockets and Datagrams

23.1 Introduction

23.2 Connection-Oriented vs. Connectionless Communication

23.3 Protocols for Transporting Data

23.4 Establishing a Simple TCP Server (Using Stream Sockets)

23.5 Establishing a Simple TCP Client (Using Stream Sockets)

23.6 Client/Server Interaction with Stream-Socket Connections

23.7 Connectionless Client/Server Interaction with Datagrams

23.8 Client/Server Tic-Tac-Toe Using a Multithreaded Server

23.9 WebBrowser Control

23.10 .NET Remoting

23.11 Wrap-Up

24 Data Structures

24.1 Introduction

24.2 Simple-Type Structure s, Boxing and Unboxing

24.3 Self-Referential Classes

24.4 Linked Lists

24.5 Stacks

24.6 Queues

24.7 Trees

24.7.1 Binary Search Tree of Integer Values

24.7.2 Binary Search Tree of IComparable Objects

24.8 Wrap-Up

25 Generics

25.1 Introduction

25.2 Motivation for Generic Methods

25.3 Generic Method Implementation

25.4 Type Constraints

25.5 Overloading Generic Methods

25.6 Generic Classes

25.7 Multiple Constraints

25.8 Notes on Generics and Inheritance

25.9 Wrap-Up

26 Collections

26.1 Collection Classes

26.1.1 Class Array

26.1.2 Class ArrayList

26.1.3 Class Stack

26.1.4 Class Hashtable

26.2 Wrap-Up

27 Other Topics

27.1 Introduction

27.2 Sorting Arrays

27.2.1 Searching a Sorted Array with Binary Search

27.3 Time Class Case Study: Using Namespaces and Creating Assemblies

27.4 IDisposable Interface

A Operator Precedence Chart

B Number Systems

C Using the Visual Studio 2005 Debugger

D ASCII Character Set

E Unicode ®

F Introduction to XHTML: Part 1

G Introduction to XHTML: Part 2

H HTML/XHTML Special Characters

I HTML/XHTML Colors

J ATM Case Study Code

K UML 2: Additional Diagram Types

Index