Professional Visual Basic® 2008

Book description

The 2008 version of Visual Basic is tremendously enhanced and introduces dramatic new concepts, techniques, and features to this popular object-oriented language. Written by an elite author team, this comprehensive resource provides a clear and concise approach to using VB 2008 in the ever-expanding .NET world. This book focuses on using the latest and most powerful tools from the Microsoft arsenal within your Visual Basic solutions. You?ll examine everything from the .NET Framework to the best practices for deploying .NET applications to database access and integrating with other technologies.

Table of contents

  1. Copyright
  2. About the Authors
  3. About the Technical Editors
  4. Credits
  5. Introduction
    1. The Importance of Visual Basic
    2. Who This Book Is For
    3. What You Need to Use This Book
    4. What This Book Covers
    5. Conventions
    6. Source Code
    7. Errata
    8. p2p.wrox.com
  6. 1. Visual Basic 2008 Core Elements
    1. 1.1. Initial Keywords and Syntax
      1. 1.1.1. Console Applications
    2. 1.2. Value and Reference Types
      1. 1.2.1. Primitive Types
    3. 1.3. Commands: Conditional
      1. 1.3.1. If Then
      2. 1.3.2. Comparison Operators
      3. 1.3.3. Select Case
    4. 1.4. Value Types (Structures)
      1. 1.4.1. Boolean
      2. 1.4.2. Integer Types
        1. 1.4.2.1. Short
        2. 1.4.2.2. Integer
        3. 1.4.2.3. Long
      3. 1.4.3. Unsigned Types
      4. 1.4.4. Decimal Types
        1. 1.4.4.1. Single
        2. 1.4.4.2. Double
        3. 1.4.4.3. Decimal
      5. 1.4.5. Char and Byte
      6. 1.4.6. DateTime
    5. 1.5. Reference Types (Classes)
      1. 1.5.1. The Object Class
      2. 1.5.2. The String Class
        1. 1.5.2.1. String()
        2. 1.5.2.2. The SubString Method
        3. 1.5.2.3. The PadLeft and PadRight Methods
        4. 1.5.2.4. The String.Split Method
        5. 1.5.2.5. The String Class Is Immutable
        6. 1.5.2.6. String Constants
      3. 1.5.3. The DBNull Class and IsDBNull Function
      4. 1.5.4. Nullable Types
      5. 1.5.5. Arrays
        1. 1.5.5.1. Multidimensional Arrays
        2. 1.5.5.2. The UBound Function
        3. 1.5.5.3. The ReDim Statement
          1. 1.5.5.3.1. The Preserve Keyword
      6. 1.5.6. Collections
        1. 1.5.6.1. Specialized and Generic Collections
    6. 1.6. Commands: Looping Statements
      1. 1.6.1. For Each and For Next
      2. 1.6.2. While, Do While, and Do Until
    7. 1.7. Boxing
    8. 1.8. Parameter Passing
      1. 1.8.1. ParamArray
    9. 1.9. Variable Scope
    10. 1.10. Data Type Conversions
      1. 1.10.1. Implicit Conversions and Compiler Options
      2. 1.10.2. XML Literals
      3. 1.10.3. Performing Explicit Conversions
        1. 1.10.3.1. Parse and TryParse
        2. 1.10.3.2. CType
        3. 1.10.3.3. DirectCast and TryCast
    11. 1.11. Summary
  7. 2. Object Syntax Introduction
    1. 2.1. Object-Oriented Terminology
      1. 2.1.1. Objects, Classes, and Instances
      2. 2.1.2. Composition of an Object
        1. 2.1.2.1. Interface
        2. 2.1.2.2. Implementation or Behavior
        3. 2.1.2.3. Fields or Instance Variables
    2. 2.2. Working with Objects
      1. 2.2.1. Object Declaration and Instantiation
      2. 2.2.2. Object References
      3. 2.2.3. Dereferencing Objects
      4. 2.2.4. Early Binding versus Late Binding
        1. 2.2.4.1. Implementing Late Binding
        2. 2.2.4.2. Using the CType Function
        3. 2.2.4.3. Using the DirectCast Function
        4. 2.2.4.4. Using the TryCast Function
    3. 2.3. Creating Classes
      1. 2.3.1. Basic Classes
        1. 2.3.1.1. The Class Keyword
        2. 2.3.1.2. Fields
        3. 2.3.1.3. Methods
          1. 2.3.1.3.1. Methods That Return Values
          2. 2.3.1.3.2. Indicating Method Scope
          3. 2.3.1.3.3. Method Parameters
        4. 2.3.1.4. Properties
          1. 2.3.1.4.1. Parameterized Properties
          2. 2.3.1.4.2. Read-Only Properties
          3. 2.3.1.4.3. Write-Only Properties
          4. 2.3.1.4.4. The Default Property
        5. 2.3.1.5. Events
          1. 2.3.1.5.1. Handling Events
          2. 2.3.1.5.2. Handling Multiple Events
          3. 2.3.1.5.3. The WithEvents Keyword
          4. 2.3.1.5.4. Raising Events
          5. 2.3.1.5.5. Declaring and Raising Custom Events
          6. 2.3.1.5.6. Receiving Events with WithEvents
          7. 2.3.1.5.7. Receiving Events with AddHandler
      2. 2.3.2. Constructor Methods
        1. 2.3.2.1. Parameterized Constructors
      3. 2.3.3. Termination and Cleanup
    4. 2.4. Advanced Concepts
      1. 2.4.1. Overloading Methods
        1. 2.4.1.1. Method Signatures
        2. 2.4.1.2. Combining Overloading and Optional Parameters
      2. 2.4.2. Overloading Constructor Methods
        1. 2.4.2.1. Overloading the Constructor Method
      3. 2.4.3. Shared Methods, Variables, and Events
        1. 2.4.3.1. Shared Variables
        2. 2.4.3.2. Shared Methods
        3. 2.4.3.3. Shared Properties
        4. 2.4.3.4. Shared Events
        5. 2.4.3.5. Shared Constructor
      4. 2.4.4. Operator Overloading
        1. 2.4.4.1. Defining AndAlso and OrElse
      5. 2.4.5. Delegates
        1. 2.4.5.1. Declaring a Delegate
        2. 2.4.5.2. Using the Delegate Data Type
        3. 2.4.5.3. Implementing a Delegate Method
      6. 2.4.6. Classes versus Components
    5. 2.5. Summary
  8. 3. Object-Oriented Programming
    1. 3.1. Inheritance
      1. 3.1.1. Implementing Inheritance
        1. 3.1.1.1. Creating a Base Class
        2. 3.1.1.2. Creating a Subclass
          1. 3.1.1.2.1. The Inherits Keyword
        3. 3.1.1.3. Overloading Methods
        4. 3.1.1.4. Overriding Methods
          1. 3.1.1.4.1. The Overridable Keyword
          2. 3.1.1.4.2. The Overrides Keyword
          3. 3.1.1.4.3. The MyBase Keyword
          4. 3.1.1.4.4. Virtual Methods
          5. 3.1.1.4.5. Overriding Overloaded Methods
        5. 3.1.1.5. Shadowing
          1. 3.1.1.5.1. Overriding Nonvirtual Methods
          2. 3.1.1.5.2. Shadowing Arbitrary Elements
        6. 3.1.1.6. Levels of Inheritance
          1. 3.1.1.6.1. Multiple Inheritance
          2. 3.1.1.6.2. Multilevel Inheritance
        7. 3.1.1.7. Interacting with the Base Class, Your Class, and Your Object
          1. 3.1.1.7.1. The Me Keyword
          2. 3.1.1.7.2. The MyBase Keyword
          3. 3.1.1.7.3. The MyClass Keyword
        8. 3.1.1.8. Constructors
          1. 3.1.1.8.1. Simple Constructors
          2. 3.1.1.8.2. Constructors in More Depth
          3. 3.1.1.8.3. Constructors with Parameters
          4. 3.1.1.8.4. Constructors, Overloading, and Variable Initialization
          5. 3.1.1.8.5. More Constructors with Parameters
        9. 3.1.1.9. Protected Scope
          1. 3.1.1.9.1. Protected Variables
        10. 3.1.1.10. Events and Inheritance
          1. 3.1.1.10.1. Inheriting Events
          2. 3.1.1.10.2. Raising Events from Subclasses
        11. 3.1.1.11. Shared Methods
          1. 3.1.1.11.1. Overloading Shared Methods
          2. 3.1.1.11.2. Shadowing Shared Methods
        12. 3.1.1.12. Shared Events
        13. 3.1.1.13. Creating an Abstract Base Class
          1. 3.1.1.13.1. MustInherit Keyword
          2. 3.1.1.13.2. MustOverride Keyword
          3. 3.1.1.13.3. Abstract Base Classes
      2. 3.1.2. Preventing Inheritance
    2. 3.2. Multiple Interfaces
      1. 3.2.1. Object Interfaces
        1. 3.2.1.1. Using the Native Interface
      2. 3.2.2. Secondary Interfaces
        1. 3.2.2.1. Defining the Interface
        2. 3.2.2.2. Using the Interface
        3. 3.2.2.3. Implementing the Interface
          1. 3.2.2.3.1. Reusing Common Implementation
        4. 3.2.2.4. Combining Interfaces and Inheritance
    3. 3.3. Abstraction
    4. 3.4. Encapsulation
    5. 3.5. Polymorphism
      1. 3.5.1. Method Signatures
      2. 3.5.2. Implementing Polymorphism
        1. 3.5.2.1. Polymorphism through Late Binding
        2. 3.5.2.2. Polymorphism with Multiple Interfaces
        3. 3.5.2.3. Polymorphism through Reflection
        4. 3.5.2.4. Polymorphism via Reflection and Multiple Interfaces
        5. 3.5.2.5. Polymorphism with Inheritance
        6. 3.5.2.6. Polymorphism Summary
    6. 3.6. Inheritance
      1. 3.6.1. When to Use Inheritance
        1. 3.6.1.1. Application versus Framework Inheritance
      2. 3.6.2. Inheritance and Multiple Interfaces
        1. 3.6.2.1. Applying Inheritance and Multiple Interfaces
          1. 3.6.2.1.1. Creating the Contact Base Class
          2. 3.6.2.1.2. Subclassing Contact
          3. 3.6.2.1.3. Implementing IPrintableObject
      3. 3.6.3. How Deep to Go?
      4. 3.6.4. The Fragile-Base-Class Problem
        1. 3.6.4.1. Interface Changes
        2. 3.6.4.2. Implementation Changes
    7. 3.7. Summary
  9. 4. The Common Language
    1. 4.1. Elements of a .NET Application
      1. 4.1.1. Modules
      2. 4.1.2. Assemblies
      3. 4.1.3. Types
    2. 4.2. Versioning and Deployment
      1. 4.2.1. Better Support for Versioning
      2. 4.2.2. Better Deployment
    3. 4.3. Cross-Language Integration
      1. 4.3.1. The Common Type System
      2. 4.3.2. Metadata
      3. 4.3.3. Better Support for Metadata
      4. 4.3.4. Attributes
      5. 4.3.5. The Reflection API
    4. 4.4. IL Disassembler
    5. 4.5. Memory Management
      1. 4.5.1. Traditional Garbage Collection
        1. 4.5.1.1. Circular References
        2. 4.5.1.2. The CLR's Garbage Collector
        3. 4.5.1.3. The Finalize Method
        4. 4.5.1.4. The IDisposable Interface
        5. 4.5.1.5. Using IDisposable
      2. 4.5.2. Faster Memory Allocation for Objects
      3. 4.5.3. Garbage Collector Optimizations
    6. 4.6. Summary
  10. 5. Localization
    1. 5.1. Cultures and Regions
      1. 5.1.1. Understanding Culture Types
      2. 5.1.2. Looking at Your Thread
    2. 5.2. Declaring Culture Globally in ASP.NET
    3. 5.3. Adopting Culture Settings in ASP.NET
    4. 5.4. Translating Values and Behaviors
      1. 5.4.1. Understanding Differences in Dates
      2. 5.4.2. Understanding Differences in Numbers and Currencies
      3. 5.4.3. Understanding Differences in Sorting Strings
    5. 5.5. Working with ASP.NET Resource Files
      1. 5.5.1. Making Use of Local Resources
        1. 5.5.1.1. Adding Another Language Resource File
        2. 5.5.1.2. Finalizing the Building of the Default.aspx Page
        3. 5.5.1.3. Neutral Cultures Are Generally Preferred
      2. 5.5.2. Making Use of Global Resources
    6. 5.6. Resource Files in Windows Forms
    7. 5.7. Summary
  11. 6. Generics
    1. 6.1. Using Generics
      1. 6.1.1. Generic Types
        1. 6.1.1.1. Basic Usage
        2. 6.1.1.2. Inheritance
      2. 6.1.2. Generic Methods
    2. 6.2. Creating Generics
      1. 6.2.1. Generic Types
        1. 6.2.1.1. Classes
        2. 6.2.1.2. Other Generic Class Features
        3. 6.2.1.3. Classes and Inheritance
        4. 6.2.1.4. Structures
        5. 6.2.1.5. Interfaces
      2. 6.2.2. Generic Methods
      3. 6.2.3. Constraints
        1. 6.2.3.1. Type Constraints
        2. 6.2.3.2. Class and Structure Constraints
        3. 6.2.3.3. New Constraints
        4. 6.2.3.4. Multiple Constraints
      4. 6.2.4. Generics and Late Binding
    3. 6.3. Summary
  12. 7. Namespaces
    1. 7.1. What Is a Namespace?
      1. 7.1.1. Namespaces and References
      2. 7.1.2. Common Namespaces
    2. 7.2. Importing and Aliasing Namespaces
      1. 7.2.1. Importing Namespaces
      2. 7.2.2. Aliasing Namespaces
      3. 7.2.3. Referencing Namespaces in ASP.NET
    3. 7.3. Creating Your Own Namespaces
    4. 7.4. The My Keyword
      1. 7.4.1. My.Application
      2. 7.4.2. My.Computer
      3. 7.4.3. My.Forms Namespace
      4. 7.4.4. My.Resources
      5. 7.4.5. My.User
      6. 7.4.6. My.WebServices
    5. 7.5. Extending the My Namespace
    6. 7.6. Summary
  13. 8. Exception Handling and Debugging
    1. 8.1. A Brief Review of Error Handling in VB6
    2. 8.2. Exceptions in .NET
      1. 8.2.1. Important Properties and Methods of an Exception
      2. 8.2.2. How Exceptions Differ from the Err Object in VB6
    3. 8.3. Structured Exception-Handling Keywords
      1. 8.3.1. The Try, Catch, and Finally Keywords
      2. 8.3.2. The Throw Keyword
      3. 8.3.3. Throwing a New Exception
      4. 8.3.4. The Exit Try Statement
      5. 8.3.5. Nested Try Structures
      6. 8.3.6. Using Exception Properties
      7. 8.3.7. The Message Property
      8. 8.3.8. The InnerException and TargetSite Properties
        1. 8.3.8.1. Source and StackTrace
        2. 8.3.8.2. GetBaseException
        3. 8.3.8.3. HelpLink
    4. 8.4. Interoperability with VB6-Style Error Handling
    5. 8.5. Error Logging
      1. 8.5.1. The Event Log
      2. 8.5.2. Events, Methods, and Properties
      3. 8.5.3. Writing to Trace Files
    6. 8.6. Analyzing Problems and Measuring Performance via the Trace Class
    7. 8.7. Summary
  14. 9. Data Access with ADO.NET 3.5
    1. 9.1. ADO.NET Architecture
    2. 9.2. Basic ADO.NET Features
      1. 9.2.1. Common ADO.NET Tasks
        1. 9.2.1.1. Selecting Data
        2. 9.2.1.2. Inserting Data
        3. 9.2.1.3. Updating Data
        4. 9.2.1.4. Deleting Data
      2. 9.2.2. Basic ADO.NET Namespaces and Classes
      3. 9.2.3. ADO.NET Components
    3. 9.3. .NET Data Providers
      1. 9.3.1. Connection Object
        1. 9.3.1.1. Connection String Format — OleDbConnection
        2. 9.3.1.2. Connection-String Format — SqlConnection
      2. 9.3.2. Command Object
      3. 9.3.3. Using Stored Procedures with Command Objects
        1. 9.3.3.1. Creating a Stored Procedure
        2. 9.3.3.2. Calling the Stored Procedure
      4. 9.3.4. DataReader Object
      5. 9.3.5. Executing Commands Asynchronously
      6. 9.3.6. DataAdapter Objects
      7. 9.3.7. SQL Server .NET Data Provider
      8. 9.3.8. OLE DB .NET Data Provider
    4. 9.4. The DataSet Component
      1. 9.4.1. DataTableCollection
      2. 9.4.2. DataRelationCollection
      3. 9.4.3. ExtendedProperties
      4. 9.4.4. Creating and Using DataSet Objects
        1. 9.4.4.1. Programmatically Creating DataSet Objects
      5. 9.4.5. ADO.NET DataTable Objects
      6. 9.4.6. Advanced ADO.NET Features of the DataSet and DataTable Objects
        1. 9.4.6.1. Indexing
        2. 9.4.6.2. Serialization
        3. 9.4.6.3. DataReader Integration
        4. 9.4.6.4. DataTable Independence
    5. 9.5. Working with the Common Provider Model
    6. 9.6. Connection Pooling in ADO.NET
    7. 9.7. Building a Data-Access Component
      1. 9.7.1. Constructors
      2. 9.7.2. Properties
      3. 9.7.3. Stored Procedure XML Structure
      4. 9.7.4. Methods
        1. 9.7.4.1. ExecSpReturnDataSet
          1. 9.7.4.1.1. BuildParameters
        2. 9.7.4.2. ExecSpReturnDataReader
        3. 9.7.4.3. ExecSpReturnXmlReader
        4. 9.7.4.4. ExecSp
        5. 9.7.4.5. ExecSpOutputValues
      5. 9.7.5. Using DataSet Objects to Bind to DataGrids
    8. 9.8. Summary
  15. 10. Using XML in Visual Basic 2008
    1. 10.1. An Introduction to XML
    2. 10.2. XML Serialization
      1. 10.2.1. Source Code Style Attributes
    3. 10.3. System.Xml Document Support
    4. 10.4. XML Stream-Style Parsers
      1. 10.4.1. Writing an XML Stream
      2. 10.4.2. Reading an XML Stream
        1. 10.4.2.1. The XmlReaderSettings Class
        2. 10.4.2.2. Traversing XML Using XmlTextReader
        3. 10.4.2.3. Handling Exceptions
      3. 10.4.3. Using the MemoryStream Object
      4. 10.4.4. Document Object Model (DOM)
        1. 10.4.4.1. DOM Traversing Raw XML Elements
        2. 10.4.4.2. DOM Traversing XML Attributes
    5. 10.5. XSLT Transformations
      1. 10.5.1. XSLT Transforming between XML Standards
      2. 10.5.2. Other Classes and Interfaces in System.Xml.Xsl
    6. 10.6. ADO.NET
      1. 10.6.1. ADO.NET and SQL Server 2000's Built-in XML Features
      2. 10.6.2. XML and SQL Server 2005
      3. 10.6.3. XML and SQL Server 2008
    7. 10.7. XML in ASP.NET 3.5
      1. 10.7.1. The XmlDataSource Server Control
      2. 10.7.2. The XmlDataSource Control's Namespace Problem
      3. 10.7.3. The Xml Server Control
    8. 10.8. Summary
  16. 11. LINQ
    1. 11.1. LINQ to SQL and Visual Studio 2008
      1. 11.1.1. Calling the Products Table Using LINQ to SQL: Creating the Console Application
      2. 11.1.2. Adding a LINQ to SQL Class
      3. 11.1.3. Introducing the O/R Designer
      4. 11.1.4. Creating the Product Object
    2. 11.2. How Objects Map to LINQ Objects
      1. 11.2.1. The DataContext Object
        1. 11.2.1.1. Using ExecuteQuery
        2. 11.2.1.2. Using Connection
        3. 11.2.1.3. Using Transaction
        4. 11.2.1.4. Other Methods and Properties of the DataContext Object
      2. 11.2.2. The Table(TEntity) object
    3. 11.3. Working Without the O/R Designer
      1. 11.3.1. Creating Your Own Custom Object
      2. 11.3.2. Querying with Your Custom Object and LINQ
      3. 11.3.3. Limiting the Columns Called with the Query
      4. 11.3.4. Working with Column Names
      5. 11.3.5. Creating Your Own DataContext Object
    4. 11.4. Custom Objects and the O/R Designer
    5. 11.5. Querying the Database
      1. 11.5.1. Using Query Expressions
      2. 11.5.2. Query Expressions in Detail
      3. 11.5.3. Filtering Using Expressions
      4. 11.5.4. Performing Joins
      5. 11.5.5. Grouping Items
    6. 11.6. Stored Procedures
    7. 11.7. LINQ to XML
    8. 11.8. LINQ to XML and .NET 3.5
      1. 11.8.1. New Objects for Creating XML Documents
      2. 11.8.2. Visual Basic 2008 Ventures Down Another Path
      3. 11.8.3. Namespaces and Prefixes
    9. 11.9. New XML Objects from the .NET Framework 3.5
      1. 11.9.1. XDocument
      2. 11.9.2. XElement
      3. 11.9.3. XNamespace
      4. 11.9.4. XComment
      5. 11.9.5. XAttribute
    10. 11.10. Visual Basic 2008 and XML Literals
    11. 11.11. Using LINQ to Query XML Documents
      1. 11.11.1. Querying Static XML Documents
      2. 11.11.2. Querying Dynamic XML Documents
    12. 11.12. Working Around the XML Document
      1. 11.12.1. Reading from an XML Document
      2. 11.12.2. Writing to an XML Document
    13. 11.13. Using LINQ to SQL with LINQ to XML
      1. 11.13.1. Setting Up the LINQ to SQL Components
      2. 11.13.2. Querying the Database and Outputting XML
    14. 11.14. Summary
  17. 12. Security in the .NET Framework
    1. 12.1. Security Concepts and Definitions
    2. 12.2. Permissions in the System.Security.Permissions Namespace
      1. 12.2.1. Code Access Permissions
      2. 12.2.2. Role-Based Permissions
      3. 12.2.3. Identity Permissions
    3. 12.3. Managing Code Access Permissions
    4. 12.4. Managing Security Policy
      1. 12.4.1. Determining an Application's Minimum Permissions
      2. 12.4.2. Using Visual Studio to Figure Minimum Permissions
      3. 12.4.3. Security Tools
        1. 12.4.3.1. Permissions and Assembly Management Tools
        2. 12.4.3.2. Certificate Management Tools
      4. 12.4.4. Exceptions Using the SecurityException Class
    5. 12.5. Cryptography Basics
      1. 12.5.1. Hash Algorithms
        1. 12.5.1.1. Cryptographic Hash Algorithms
          1. 12.5.1.1.1. SHA
          2. 12.5.1.1.2. MD5
          3. 12.5.1.1.3. RIPEMD-160
          4. 12.5.1.1.4. Secret Key Encryption
          5. 12.5.1.1.5. PKCS
          6. 12.5.1.1.6. Digital Signature Basics
        2. 12.5.1.2. X.509 Certificates
        3. 12.5.1.3. Secure Sockets Layer
    6. 12.6. Summary
  18. 13. Visual Studio 2008
    1. 13.1. Visual Studio 2008: Express through Team Suite
      1. 13.1.1. Creating a Project from a Project Template
      2. 13.1.2. The Solution Explorer
      3. 13.1.3. My Project Properties
      4. 13.1.4. Assembly Information Screen
        1. 13.1.4.1. Assembly Attributes
      5. 13.1.5. Compile Settings
      6. 13.1.6. Debug Properties
      7. 13.1.7. References
      8. 13.1.8. Resources
      9. 13.1.9. Settings
    2. 13.2. Project ProVB_VS in Visual Studio
      1. 13.2.1. Form Properties Set in Code
        1. 13.2.1.1. Code Regions
        2. 13.2.1.2. Tabs versus MDI
        3. 13.2.1.3. Running ProVB_VS
        4. 13.2.1.4. Customizing the Text Editor
        5. 13.2.1.5. IntelliSense, Code Expansion, and Code Snippets
          1. 13.2.1.5.1. IntelliSense
          2. 13.2.1.5.2. Code Expansion
          3. 13.2.1.5.3. Code Snippets
      2. 13.2.2. Additional Components for Visual Studio 2008
    3. 13.3. Enhancing a Sample Application
      1. 13.3.1. Customizing the Code
        1. 13.3.1.1. Adding XML Comments
        2. 13.3.1.2. Customizing the Event Handler
        3. 13.3.1.3. Reviewing the Code
      2. 13.3.2. Building Applications
        1. 13.3.2.1. Running an Application in the Debugger
          1. 13.3.2.1.1. Breakpoints
        2. 13.3.2.2. Other Debug-Related Windows
          1. 13.3.2.2.1. Output
          2. 13.3.2.2.2. Call Stack
          3. 13.3.2.2.3. Locals
          4. 13.3.2.2.4. Watch Windows
          5. 13.3.2.2.5. Immediate Window
          6. 13.3.2.2.6. Autos
    4. 13.4. Useful Features of Visual Studio 2008
      1. 13.4.1. Build Configurations
      2. 13.4.2. The Task List
      3. 13.4.3. The Command Window
      4. 13.4.4. Server Explorer
      5. 13.4.5. Recording and Using Macros in Visual Studio 2008
      6. 13.4.6. Class Diagrams
      7. 13.4.7. Team System
        1. 13.4.7.1. Team Foundation Server (TFS)
        2. 13.4.7.2. Team Editions
      8. 13.4.8. Team Edition for Developers
        1. 13.4.8.1. Code Analysis
      9. 13.4.9. Performance Tools
      10. 13.4.10. Unit Tests
    5. 13.5. Summary
  19. 14. Working with SQL Server
    1. 14.1. SQL Server Compact Edition
      1. 14.1.1. Connecting to a SQL Server Compact Edition Database
      2. 14.1.2. Synchronizing Data
    2. 14.2. CLR Integration in SQL Server 2005
      1. 14.2.1. Deciding between T-SQL and Visual Basic
      2. 14.2.2. Creating User-Defined Types
        1. 14.2.2.1. Creating Functions
        2. 14.2.2.2. Using the User-Defined Function
      3. 14.2.3. Creating Stored Procedures
        1. 14.2.3.1. Returning Data from the Stored Procedure
          1. 14.2.3.1.1. Returning a Single Value
          2. 14.2.3.1.2. Returning Multiple Values
      4. 14.2.4. Exposing Web Services from SQL Server
        1. 14.2.4.1. Accessing the Web Service
    3. 14.3. Summary
    4. 14.4. Resources
  20. 15. Windows Forms
    1. 15.1. Changes in Windows Forms Version 2.0
      1. 15.1.1. Changes to Existing Controls
        1. 15.1.1.1. Smart Tags
        2. 15.1.1.2. AutoCompletion in Text Boxes and Combo Boxes
        3. 15.1.1.3. New Properties for All Controls
        4. 15.1.1.4. MaximumSize and MinimumSize Properties
        5. 15.1.1.5. UseWaitCursor Property
      2. 15.1.2. New Controls
        1. 15.1.2.1. WebBrowser Control
        2. 15.1.2.2. MaskedTextbox Control
        3. 15.1.2.3. TableLayoutPanel and FlowLayoutPanel Controls
      3. 15.1.3. Replacements for Older Windows Forms Controls
      4. 15.1.4. Default Instances of Forms
    2. 15.2. The System.Windows.Forms Namespace
    3. 15.3. Using Forms
      1. 15.3.1. Showing Forms via Sub Main
      2. 15.3.2. Setting the Startup Form
      3. 15.3.3. Startup Location
      4. 15.3.4. Form Borders
      5. 15.3.5. Always on Top — The TopMost Property
      6. 15.3.6. Owned Forms
        1. 15.3.6.1. AddOwnedForm Method
        2. 15.3.6.2. Owner Property
        3. 15.3.6.3. OwnedForms Collection
      7. 15.3.7. Making Forms Transparent and Translucent
        1. 15.3.7.1. The Opacity Property
        2. 15.3.7.2. The TransparencyKey Property
        3. 15.3.7.3. The Region Property
      8. 15.3.8. Visual Inheritance
      9. 15.3.9. Scrollable Forms
      10. 15.3.10. MDI Forms
        1. 15.3.10.1. Creating an MDI Parent Form
        2. 15.3.10.2. Differences in MDI Parent Forms between VB6 and VB 2008
        3. 15.3.10.3. MDI Child Forms
      11. 15.3.11. An MDI Example in VB 2008
        1. 15.3.11.1. Arranging Child Windows
      12. 15.3.12. Dialog Forms
        1. 15.3.12.1. DialogResult
      13. 15.3.13. Forms at Runtime
    4. 15.4. Controls
      1. 15.4.1. Control Tab Order
      2. 15.4.2. Dynamic Sizing and Positioning of Controls
        1. 15.4.2.1. Docking
        2. 15.4.2.2. Anchoring
        3. 15.4.2.3. Sizable Containers
      3. 15.4.3. FlowLayoutPanel Control
        1. 15.4.3.1. Padding and Margin Properties
      4. 15.4.4. TableLayoutPanel Control
      5. 15.4.5. Panel and GroupBox Container Controls
      6. 15.4.6. Extender Providers
        1. 15.4.6.1. ToolTip
        2. 15.4.6.2. HelpProvider
        3. 15.4.6.3. ErrorProvider
        4. 15.4.6.4. Properties of Extender Providers
        5. 15.4.6.5. Working with Extender Providers in Code
      7. 15.4.7. Advanced Capabilities for Data Entry
        1. 15.4.7.1. Autocompletion
        2. 15.4.7.2. MaskedTextbox Control
      8. 15.4.8. Validating Data Entry
        1. 15.4.8.1. The Validating Event
        2. 15.4.8.2. The CausesValidation Property
      9. 15.4.9. Toolbars and the New ToolStrip Control
        1. 15.4.9.1. Creating a ToolStrip and Adding Toolbar Elements
        2. 15.4.9.2. Allowing the User to Move Toolbar Elements
        3. 15.4.9.3. Creating a Standard Set of Toolbar Elements
      10. 15.4.10. Menus
        1. 15.4.10.1. Adding Standard Items to a Menu
        2. 15.4.10.2. Icons and Checkmarks for Menu Items
        3. 15.4.10.3. Context Menus
        4. 15.4.10.4. Dynamically Manipulating Menus at Runtime
      11. 15.4.11. Common Dialogs
        1. 15.4.11.1. OpenFileDialog and SaveFileDialog
        2. 15.4.11.2. ColorDialog Control
        3. 15.4.11.3. FontDialog Control
        4. 15.4.11.4. Printer Dialog Controls
      12. 15.4.12. Drag and Drop
      13. 15.4.13. Summary of Standard Windows.Forms Controls
      14. 15.4.14. Retired Controls
      15. 15.4.15. Handling Groups of Related Controls
      16. 15.4.16. Adding Controls at Runtime
    5. 15.5. Other Handy Programming Tips
    6. 15.6. Summary
  21. 16. Windows Forms Advanced Features
    1. 16.1. Packaging Logic in Visual Controls
    2. 16.2. Custom Controls in Windows Forms
      1. 16.2.1. Inheriting from an Existing Control
      2. 16.2.2. Building a Composite Control
      3. 16.2.3. Writing a Control from Scratch
    3. 16.3. Inheriting from an Existing Control
      1. 16.3.1. Process Overview
      2. 16.3.2. Writing Code for an Inherited Control
        1. 16.3.2.1. Creating a Property for a Custom Control
        2. 16.3.2.2. Coordinating with the Visual Studio IDE
          1. 16.3.2.2.1. Attributes
        3. 16.3.2.3. Setting a Default Value with an Attribute
        4. 16.3.2.4. Alternate Techniques for Working with the IDE
          1. 16.3.2.4.1. Providing a Reset Method for a Control Property
      3. 16.3.3. Other Useful Attributes
      4. 16.3.4. Defining a Custom Event for the Inherited Control
      5. 16.3.5. A CheckedListBox Limiting Selected Items
    4. 16.4. The Control and UserControl Base Classes
      1. 16.4.1. The Control Class
      2. 16.4.2. The UserControl Class
    5. 16.5. A Composite UserControl
      1. 16.5.1. Creating a Composite UserControl
      2. 16.5.2. Resizing the Control
      3. 16.5.3. Exposing Properties of Contained Controls
      4. 16.5.4. Stepping Through the Example
    6. 16.6. Building a Control from Scratch
      1. 16.6.1. Painting a Custom Control with GDI+
        1. 16.6.1.1. What Is GDI+?
        2. 16.6.1.2. The System.Drawing Namespace
        3. 16.6.1.3. The System.Drawing.Graphics Class
        4. 16.6.1.4. Using GDI+ Capabilities in a Windows Form
    7. 16.7. Attaching an Icon for the Toolbox
    8. 16.8. Embedding Controls in Other Controls
    9. 16.9. Summary
  22. 17. Windows Presentation Foundation
    1. 17.1. What, Where, Why, How — WPF Strategy
    2. 17.2. Raster Graphics and Vector Graphics
    3. 17.3. Should Your Next Windows Project Use WPF?
    4. 17.4. Creating a WPF Application
      1. 17.4.1. Leveraging WPF with XAML
        1. 17.4.1.1. XAML Language Basics
        2. 17.4.1.2. Implementing a Custom WPF Application
        3. 17.4.1.3. Controls
        4. 17.4.1.4. Event Handlers
        5. 17.4.1.5. Adding Behavior
        6. 17.4.1.6. Layout
      2. 17.4.2. Customizing the User Interface
        1. 17.4.2.1. Removing the Frame
        2. 17.4.2.2. Resources
      3. 17.4.3. Customizing the Buttons
      4. 17.4.4. Expression Blend
        1. 17.4.4.1. Dependency Properties
        2. 17.4.4.2. Styles
        3. 17.4.4.3. WPF User Controls
    5. 17.5. Summary
  23. 18. Integrating WPF and Windows Forms
    1. 18.1. The Integration Library
    2. 18.2. Hosting WPF Controls in Windows Forms
      1. 18.2.1. Creating a WPF Control Library
      2. 18.2.2. The Windows Forms Application
        1. 18.2.2.1. Laying Out Controls on the Form
        2. 18.2.2.2. Adding Custom Code to the Form
        3. 18.2.2.3. Custom Display Masking
        4. 18.2.2.4. Using a Mapped Property of a WPF Control
    3. 18.3. Hosting Windows Forms Controls in WPF
    4. 18.4. Integration Limitations
    5. 18.5. Summary
  24. 19. Working with ASP.NET 3.5
    1. 19.1. The Goals of ASP.NET
      1. 19.1.1. Developer Productivity
      2. 19.1.2. Administration and Management
      3. 19.1.3. Performance and Scalability
      4. 19.1.4. The ASP.NET Compilation System
      5. 19.1.5. Health Monitoring for Your ASP.NET Applications
      6. 19.1.6. Reading and Writing Configuration Settings
      7. 19.1.7. Localization
      8. 19.1.8. Objects for Accessing Data
    2. 19.2. The IDE for Building ASP.NET 3.5 Pages
    3. 19.3. Building ASP.NET Applications
      1. 19.3.1. Application Location Options
        1. 19.3.1.1. The Built-in Web Server
      2. 19.3.2. IIS
      3. 19.3.3. FTP
      4. 19.3.4. Websites Requiring FrontPage Extensions
    4. 19.4. The ASP.NET Page Structure Options
      1. 19.4.1. Inline Coding
      2. 19.4.2. Code-Behind Model
    5. 19.5. ASP.NET 3.5 Page Directives
    6. 19.6. ASP.NET Page Events
    7. 19.7. ASP.NET Application Folders
      1. 19.7.1. \App_Code Folder
      2. 19.7.2. \App_Data Folder
      3. 19.7.3. \App_Themes Folder
      4. 19.7.4. \App_GlobalResources Folder
      5. 19.7.5. \App_LocalResources
      6. 19.7.6. \App_WebReferences
      7. 19.7.7. \App_Browsers
    8. 19.8. Global.asax
    9. 19.9. ASP.NET Server Controls
      1. 19.9.1. Types of Server Controls
      2. 19.9.2. Building with Server Controls
        1. 19.9.2.1. Working with Server Controls on a Design Surface
        2. 19.9.2.2. Coding Server Controls
      3. 19.9.3. Working with Server Control Events
    10. 19.10. Manipulating Pages and Server Controls with JavaScript
      1. 19.10.1. Using Page.ClientScript.RegisterClientScriptBlock
      2. 19.10.2. Using Page.ClientScript.RegisterStartupScript
      3. 19.10.3. Using Page.ClientScript.RegisterClientScriptInclude
    11. 19.11. Summary
  25. 20. ASP.NET 3.5 Advanced Features
    1. 20.1. Applications and Pages
      1. 20.1.1. Cross-Page Posting
      2. 20.1.2. ASP.NET Compilation
    2. 20.2. Master Pages
      1. 20.2.1. Creating a Master Page
      2. 20.2.2. Creating the Content Page
      3. 20.2.3. Declaring the Master Page Application-Wide
      4. 20.2.4. Providing Default Content in Your Master Page
    3. 20.3. Data-Driven Applications
      1. 20.3.1. Using the GridView and SqlDataSource Controls
      2. 20.3.2. Allowing Editing and Deleting of Records with GridView
      3. 20.3.3. Don't Stop There!
    4. 20.4. Navigation
      1. 20.4.1. Using the SiteMapPath Server Control
      2. 20.4.2. Menu Server Control
      3. 20.4.3. The TreeView Server Control
    5. 20.5. Membership and Role Management
    6. 20.6. Personalization
    7. 20.7. Configuring ASP.NET in IIS on Vista
    8. 20.8. Working with the ASP.NET Provider Model
      1. 20.8.1. Working with Microsoft SQL Server from 7.0 to 2008
        1. 20.8.1.1. The ASP.NET SQL Server Setup Wizard Command-Line Tool
        2. 20.8.1.2. The ASP.NET SQL Server Setup Wizard GUI Tool
        3. 20.8.1.3. Connecting Your Default Provider to a New SQL Server Instance
    9. 20.9. ASP.NET AJAX
      1. 20.9.1. Understanding the Need for AJAX
        1. 20.9.1.1. Before AJAX
        2. 20.9.1.2. AJAX Changes the Story
      2. 20.9.2. ASP.NET AJAX and Visual Studio 2008
      3. 20.9.3. Client-Side Technologies
      4. 20.9.4. Server-Side Technologies
      5. 20.9.5. Developing with ASP.NET AJAX
      6. 20.9.6. Building a Simple ASP.NET Page with AJAX
    10. 20.10. Summary
  26. 21. Silverlight Development
    1. 21.1. Looking at Silverlight
      1. 21.1.1. Silverlight browser requirements
      2. 21.1.2. Two versions of Silverlight
      3. 21.1.3. Installing Silverlight
    2. 21.2. Developing Silverlight Applications
      1. 21.2.1. Building a simple Silverlight application
        1. 21.2.1.1. Choosing the Silverlight Project Template
        2. 21.2.1.2. The Silverlight Solution
        3. 21.2.1.3. The Silverlight Canvas
    3. 21.3. Silverlight Examples
      1. 21.3.1. A simple Hello World! example
      2. 21.3.2. Working with multiple elements
      3. 21.3.3. Events and Silverlight
    4. 21.4. Summary
  27. 22. Visual Studio Tools for Office
    1. 22.1. Examining the VSTO Releases
      1. 22.1.1. Office Automation versus VSTO
      2. 22.1.2. VSTO Project Types
    2. 22.2. Office Business Application Architecture
    3. 22.3. Working with Both VBA and VSTO
    4. 22.4. Creating a Document Template (Word)
      1. 22.4.1. Adding Content to the Document
      2. 22.4.2. Adding a Ribbon and an Actions Pane
      3. 22.4.3. Activating the Actions Pane
      4. 22.4.4. Updating a Content Control
    5. 22.5. Creating an Office Add-In (Excel)
    6. 22.6. Outlook Form Regions
    7. 22.7. Summary
  28. 23. Assemblies
    1. 23.1. Assemblies
    2. 23.2. The Manifest
      1. 23.2.1. Assembly identity
        1. 23.2.1.1. The Version Number
        2. 23.2.1.2. Strong Names
        3. 23.2.1.3. Signing an Assembly with a Strong Name
        4. 23.2.1.4. The Culture
      2. 23.2.2. Referenced assemblies
        1. 23.2.2.1. The .publickeytoken Directive
        2. 23.2.2.2. The .ver Directive
        3. 23.2.2.3. The .locale Directive
    3. 23.3. Assemblies and Deployment
      1. 23.3.1. Application-private assemblies
      2. 23.3.2. Shared assemblies
        1. 23.3.2.1. The Global Assembly Cache
    4. 23.4. Versioning Issues
      1. 23.4.1. Application isolation
      2. 23.4.2. Side-by-side execution
      3. 23.4.3. Self-describing
      4. 23.4.4. Version policies
        1. 23.4.4.1. The Default Versioning Policy
        2. 23.4.4.2. Automatic Quick Fix Engineering Policy
      5. 23.4.5. Configuration files
        1. 23.4.5.1. Startup Settings
        2. 23.4.5.2. Runtime Settings
          1. 23.4.5.2.1. Loading a particular version of an assembly
          2. 23.4.5.2.2. Defining the location of an assembly
          3. 23.4.5.2.3. Providing the search path
    5. 23.5. Dynamic Loading of Assemblies
      1. 23.5.1. The Assembly class
      2. 23.5.2. Dynamic loading example
      3. 23.5.3. Putting assemblies to work
    6. 23.6. Summary
  29. 24. Deployment
    1. 24.1. Application Deployment
      1. 24.1.1. Why Deployment Is Straightforward in .NET
      2. 24.1.2. XCOPY Deployment
      3. 24.1.3. Using the Windows Installer
      4. 24.1.4. ClickOnce Deployment
    2. 24.2. New in Visual Studio 2008
    3. 24.3. Visual Studio Deployment Projects
      1. 24.3.1. Project Templates
        1. 24.3.1.1. The CAB Project Template
        2. 24.3.1.2. The Merge Module Project Template
        3. 24.3.1.3. The Setup Project Template
        4. 24.3.1.4. The Web Setup Project Template
        5. 24.3.1.5. The Smart Device CAB Project Template
        6. 24.3.1.6. The Setup Wizard
      2. 24.3.2. Creating a Deployment Project
        1. 24.3.2.1. Walk-through
          1. 24.3.2.1.1. Important Properties of the Root Setup Node
          2. 24.3.2.1.2. Properties of the Primary Output Project Item
          3. 24.3.2.1.3. Properties of the Detected Dependency Items
        2. 24.3.2.2. Creating a Deployment Project for an ASP.NET Web Application
    4. 24.4. Modifying the Deployment Project
      1. 24.4.1. Project Properties
        1. 24.4.1.1. The Build Page
          1. 24.4.1.1.1. Package Files
          2. 24.4.1.1.2. Prerequisites
          3. 24.4.1.1.3. Compression
          4. 24.4.1.1.4. Setting the Cabinet File Size
      2. 24.4.2. The File System Editor
        1. 24.4.2.1. Adding Items to a Folder
        2. 24.4.2.2. Adding Special Folders
        3. 24.4.2.3. Creating Shortcuts
      3. 24.4.3. The Registry Editor
        1. 24.4.3.1. Adding a Value to a Registry Key
        2. 24.4.3.2. Importing Registry Files
      4. 24.4.4. The File Types Editor
      5. 24.4.5. The User Interface Editor
        1. 24.4.5.1. Installation Modes
          1. 24.4.5.1.1. The Start Stage
          2. 24.4.5.1.2. The Progress Stage
          3. 24.4.5.1.3. The End Stage
        2. 24.4.5.2. Customizing the Order of Dialog Boxes
        3. 24.4.5.3. Adding Dialog Boxes
        4. 24.4.5.4. Properties of the Dialog Boxes
      6. 24.4.6. The Custom Actions Editor
        1. 24.4.6.1. Adding a Custom Action
      7. 24.4.7. The Launch Conditions Editor
        1. 24.4.7.1. Adding a File Search
        2. 24.4.7.2. Modifying the File Search Properties
        3. 24.4.7.3. Creating a Launch Condition
      8. 24.4.8. Building
    5. 24.5. Internet Deployment of Windows Applications
      1. 24.5.1. No-Touch Deployment
        1. 24.5.1.1. Automatic Updating
        2. 24.5.1.2. Using a Launch Application
        3. 24.5.1.3. Limitations of No-Touch Deployment
      2. 24.5.2. ClickOnce Deployment
        1. 24.5.2.1. Configuring an Application for ClickOnce
        2. 24.5.2.2. Online versus Locally Installed Applications
        3. 24.5.2.3. Deploying an Online Application
        4. 24.5.2.4. Deploying an Application That Is Available Offline
        5. 24.5.2.5. Files and Directories Produced by ClickOnce
        6. 24.5.2.6. Signing the Manifest
        7. 24.5.2.7. The Update Process
        8. 24.5.2.8. ClickOnce Configuration Options
        9. 24.5.2.9. The Bootstrapper
        10. 24.5.2.10. Manual Editing of ClickOnce Manifests
        11. 24.5.2.11. Rolling Back or Uninstalling ClickOnce Applications
        12. 24.5.2.12. ClickOnce versus Other Deployment Technologies
      3. 24.5.3. Custom Deployment Options
        1. 24.5.3.1. Updater Application Block
    6. 24.6. Summary
  30. 25. Working with Classic COM and Interfaces
    1. 25.1. Understanding COM
    2. 25.2. COM and .NET in Practice
      1. 25.2.1. A Legacy Component
        1. 25.2.1.1. Step 1: Defining the Interface
        2. 25.2.1.2. Step 2: Implementing the Component
        3. 25.2.1.3. Step 3: Registering the Legacy Component
      2. 25.2.2. The .NET Application
        1. 25.2.2.1. Referencing the Legacy COM Component from .NET
        2. 25.2.2.2. Inside the .NET Application
      3. 25.2.3. Trying It All Out
      4. 25.2.4. Using TlbImp Directly
      5. 25.2.5. Late Binding
        1. 25.2.5.1. An Example for Late Binding
        2. 25.2.5.2. The Sample COM Object
        3. 25.2.5.3. The Calculation Framework
        4. 25.2.5.4. Running the Calculation Framework
    3. 25.3. ActiveX Controls
      1. 25.3.1. The Legacy ActiveX Control
        1. 25.3.1.1. Step 1: Creating the Control
        2. 25.3.1.2. Step 2: Registering Your Legacy Control
      2. 25.3.2. A .NET Application, Again
      3. 25.3.3. Trying It All Out, Again
    4. 25.4. Using .NET Components in the COM World
      1. 25.4.1. A .NET Component
      2. 25.4.2. RegAsm
        1. 25.4.2.1. Testing with a VB6 Application
      3. 25.4.3. TlbExp
    5. 25.5. Summary
  31. 26. Threading
    1. 26.1. What Is a Thread?
      1. 26.1.1. Processes, AppDomains, and Threads
      2. 26.1.2. Thread Scheduling
      3. 26.1.3. Thread Safety and Thread Affinity
      4. 26.1.4. When to Use Threads
      5. 26.1.5. Designing a Background Task
      6. 26.1.6. Interactive Applications
        1. 26.1.6.1. Server Applications
    2. 26.2. Implementing Threading
      1. 26.2.1. A Quick Tour
      2. 26.2.2. Threading Options
        1. 26.2.2.1. Using the Thread Pool
          1. 26.2.2.1.1. Using the BackgroundWorker Control
          2. 26.2.2.1.2. Using BeginXYZ Methods
          3. 26.2.2.1.3. Using Delegates
          4. 26.2.2.1.4. Manually Queuing Work
          5. 26.2.2.1.5. Using System.Timers.Timer
      3. 26.2.3. Manually Creating a Thread
      4. 26.2.4. Shared Data
      5. 26.2.5. Avoid Sharing Data
        1. 26.2.5.1. Transferring Data Copies
        2. 26.2.5.2. Transferring Data Ownership
      6. 26.2.6. Sharing Data with Synchronization
        1. 26.2.6.1. Built-In Synchronization Support
      7. 26.2.7. Synchronization Objects
        1. 26.2.7.1. Exclusive Locks and the SyncLock Statement
          1. 26.2.7.1.1. Reader-Writer Locks
          2. 26.2.7.1.2. AutoReset Events
          3. 26.2.7.1.3. ManualReset Events
    3. 26.3. Summary
  32. 27. Windows Workflow Foundation
    1. 27.1. Workflow in Applications
    2. 27.2. Building Workflows
      1. 27.2.1. Adding Workflow with Windows Workflow Foundation
      2. 27.2.2. A Simple Workflow
      3. 27.2.3. Standard Activities
      4. 27.2.4. Building Custom Activities
    3. 27.3. Using Workflows with Other Applications
      1. 27.3.1. Using Workflow Foundation with Windows Forms
      2. 27.3.2. Using Workflow Foundation with ASP.NET
    4. 27.4. Summary
    5. 27.5. Resources
  33. 28. XML Web Services
    1. 28.1. Introduction to Web Services
    2. 28.2. Early Architectural Designs
      1. 28.2.1. The Network Angle
      2. 28.2.2. Application Development
      3. 28.2.3. Merging the Two with the Web
      4. 28.2.4. The Foundations of Web Services
        1. 28.2.4.1. DCOM
        2. 28.2.4.2. Remote Method Invocation in Java
      5. 28.2.5. CORBA
      6. 28.2.6. The Problems
      7. 28.2.7. The Other Players
      8. 28.2.8. What All the Foundations Missed
        1. 28.2.8.1. HTTP — A Language-Independent Protocol
        2. 28.2.8.2. XML — Cross-Language Data Markup
        3. 28.2.8.3. SOAP — The Transfer You Need
        4. 28.2.8.4. Web Services Description Language
    3. 28.3. Building a Web Service
    4. 28.4. A Realistic Example
      1. 28.4.1. Using Visual Studio 2008 to Build Web Services
        1. 28.4.1.1. Producing a Typed DataSet
        2. 28.4.1.2. Building the Service
        3. 28.4.1.3. Consuming the Service
        4. 28.4.1.4. Adding a Web Reference
        5. 28.4.1.5. Building the Consumer
    5. 28.5. Overloading WebMethods
    6. 28.6. Caching Web Service Responses
    7. 28.7. SOAP Headers
      1. 28.7.1. Building a Web Service with SOAP Headers
      2. 28.7.2. Consuming a Web Service Using SOAP Headers
      3. 28.7.3. Requesting Web Services Using SOAP 1.2
    8. 28.8. Visual Basic and System.Web.Services
      1. 28.8.1. System.Web.Services Namespace
      2. 28.8.2. System.Web.Services.Description Namespace
      3. 28.8.3. System.Web.Services.Discovery Namespace
      4. 28.8.4. System.Web.Services.Protocols Namespace
    9. 28.9. Architecting with Web Services
      1. 28.9.1. Why Web Services?
      2. 28.9.2. How This All Fits Together
      3. 28.9.3. State Management for XML Web Services
    10. 28.10. Security in Web Services
      1. 28.10.1. The Secure Sockets Layer
      2. 28.10.2. Directory-Level Security
      3. 28.10.3. Other Types of Security
    11. 28.11. The Downside
      1. 28.11.1. Security
      2. 28.11.2. State
      3. 28.11.3. Transactions
      4. 28.11.4. Speed and Connectivity
    12. 28.12. Where We Go from Here
    13. 28.13. Summary
  34. 29. Remoting
    1. 29.1. Remoting Overview
      1. 29.1.1. Basic Terminology
      2. 29.1.2. SingleCall, Singleton, and Activated Objects
        1. 29.1.2.1. SingleCall Objects
        2. 29.1.2.2. Singleton Objects
        3. 29.1.2.3. Activated Objects
        4. 29.1.2.4. Serializable Objects
    2. 29.2. Implementing Remoting
      1. 29.2.1. A Simple Example
        1. 29.2.1.1. Library DLL
        2. 29.2.1.2. Host Application
          1. 29.2.1.2.1. Setting Up the Project
          2. 29.2.1.2.2. Referencing the Library DLL
          3. 29.2.1.2.3. Configuring Remoting
          4. 29.2.1.2.4. Configuring Remoting via Code
        3. 29.2.1.3. The Client Application
          1. 29.2.1.3.1. Setting Up the Project
          2. 29.2.1.3.2. Configuring Remoting
          3. 29.2.1.3.3. Configuring Remoting via Code
      2. 29.2.2. Using IIS as a Remoting Host
        1. 29.2.2.1. Creating the Host
        2. 29.2.2.2. Updating the Client Application
        3. 29.2.2.3. Using the Binary Formatter in IIS
      3. 29.2.3. Using Activator.GetObject
      4. 29.2.4. Interface-Based Design
        1. 29.2.4.1. Interface DLL
        2. 29.2.4.2. Updating the Client Application
      5. 29.2.5. Using Generated Proxies
        1. 29.2.5.1. Proxy DLL
        2. 29.2.5.2. Creating the Client Application
    3. 29.3. Summary
  35. 30. Enterprise Services
    1. 30.1. Transactions
      1. 30.1.1. The ACID Test
    2. 30.2. Transactional Components
      1. 30.2.1. An Example of Transactions
        1. 30.2.1.1. Creating the Databases
        2. 30.2.1.2. Populating Your Databases
        3. 30.2.1.3. The Business Logic
          1. 30.2.1.3.1. The First Half of the Transaction
          2. 30.2.1.3.2. The Second Half of the Transaction
        4. 30.2.1.4. Registering Your Component
        5. 30.2.1.5. Giving the Assembly a Strong Name
        6. 30.2.1.6. Registering with Component Services
        7. 30.2.1.7. The Component Services Console
        8. 30.2.1.8. Test Application
        9. 30.2.1.9. The Transaction Attribute
        10. 30.2.1.10. Invalid Data
        11. 30.2.1.11. When Something Goes Wrong
    3. 30.3. Other Aspects of Transactions
      1. 30.3.1. Just-In-Time
      2. 30.3.2. Object Pooling
    4. 30.4. Queued Components
      1. 30.4.1. An Example of Queued Components
        1. 30.4.1.1. Consoles Again
        2. 30.4.1.2. Building the Client
        3. 30.4.1.3. Queuing Invocations
      2. 30.4.2. Transactions with Queued Components
    5. 30.5. Transactions and System.Transactions
      1. 30.5.1. Creating Transactions
      2. 30.5.2. Creating Resource Managers
    6. 30.6. Summary
  36. 31. Network Programming
    1. 31.1. Protocols, Addresses, and Ports
      1. 31.1.1. Addresses and names
      2. 31.1.2. Ports: they're not just for ships
      3. 31.1.3. Firewalls: can't live with them, can't live without them
    2. 31.2. The System.Net Namespace
      1. 31.2.1. Web requests (and responses)
        1. 31.2.1.1. Working with FileWebRequest and HttpWebRequest
        2. 31.2.1.2. Putting It Together
        3. 31.2.1.3. Working with FtpWebRequest
          1. 31.2.1.3.1. WebRequestMethods.Ftp
          2. 31.2.1.3.2. Creating an FTP Client
      2. 31.2.2. Simplifying common Web requests with WebClient
      3. 31.2.3. Creating your own web server with HttpListener
        1. 31.2.3.1. Creating Your Web Server
    3. 31.3. Summary
  37. 32. Windows Communication Foundation
    1. 32.1. The Larger Move to SOA
    2. 32.2. WCF Overview
      1. 32.2.1. Capabilities of WCF
      2. 32.2.2. Working with the WS-* protocols
    3. 32.3. Building a WCF Service
      1. 32.3.1. What makes a WCF service
      2. 32.3.2. Creating your first WCF service
        1. 32.3.2.1. Creating the Interface
        2. 32.3.2.2. Utilizing the Interface
        3. 32.3.2.3. Hosting the WCF Service in a Console Application
        4. 32.3.2.4. Reviewing the WSDL Document
    4. 32.4. Building the WCF Consumer
      1. 32.4.1. Adding a service reference
      2. 32.4.2. Reviewing the reference
      3. 32.4.3. Configuration file changes
      4. 32.4.4. Writing the consumption code
    5. 32.5. Working with Data Contracts
      1. 32.5.1. Building a service with a data contract
      2. 32.5.2. Building the host
      3. 32.5.3. Building the consumer
      4. 32.5.4. Looking at WSDL and the schema for HelloCustomerService
    6. 32.6. Namespaces
    7. 32.7. Touching on Security
    8. 32.8. Summary
  38. 33. Windows Services
    1. 33.1. Example Windows Services
    2. 33.2. Characteristics of a Windows Service
    3. 33.3. Interacting with Windows Services
    4. 33.4. Creating a Windows Service
      1. 33.4.1. The .NET Framework classes for Windows Services
        1. 33.4.1.1. The ServiceBase Class
        2. 33.4.1.2. Installation-Oriented Classes
        3. 33.4.1.3. Multiple Services within One Executable
        4. 33.4.1.4. The ServiceController Class
      2. 33.4.2. Other types of Windows Services
    5. 33.5. Creating a Windows Service in Visual Basic
    6. 33.6. Creating a Counter Monitor Service
      1. 33.6.1. Installing the service
      2. 33.6.2. Starting the service
      3. 33.6.3. Uninstalling the service
    7. 33.7. Monitoring a Performance Counter
      1. 33.7.1. Creating a performance counter
      2. 33.7.2. Integrating the counter into the service
      3. 33.7.3. Changing the value in the performance counter
    8. 33.8. Communicating with the Service
      1. 33.8.1. The ServiceController class
      2. 33.8.2. Integrating a ServiceController into the example
      3. 33.8.3. More about ServiceController
    9. 33.9. Custom Commands
    10. 33.10. Passing Strings to a Service
    11. 33.11. Creating a File Watcher
      1. 33.11.1. Writing events using an Event Log
      2. 33.11.2. Creating a FileSystemWatcher
        1. 33.11.2.1. The FileSystemWatcher Component
        2. 33.11.2.2. The EnableRaisingEvents Property
        3. 33.11.2.3. The Path Property
        4. 33.11.2.4. The NotifyFilter Property
        5. 33.11.2.5. The Filter Property
        6. 33.11.2.6. The IncludeSubdirectories Property
        7. 33.11.2.7. Adding FileSystemWatcher Code to OnStart and OnStop
        8. 33.11.2.8. The EventLog Component
        9. 33.11.2.9. The Created Event
    12. 33.12. Debugging the Service
    13. 33.13. Summary
  39. 34. Visual Basic and the Internet
    1. 34.1. Downloading Internet Resources
    2. 34.2. Sockets
      1. 34.2.1. Building the Application
      2. 34.2.2. Creating conversation windows
        1. 34.2.2.1. Creating the Conversation Form
        2. 34.2.2.2. Initiating Connections
        3. 34.2.2.3. Receiving Inbound Connections
      3. 34.2.3. Sending messages
        1. 34.2.3.1. The Message Class
      4. 34.2.4. Shutting down the application
    3. 34.3. Using Internet Explorer in Your Applications
      1. 34.3.1. Windows Forms and HTML — no problem!
        1. 34.3.1.1. Allowing Simple Web Browsing in Your Windows Application
        2. 34.3.1.2. Launching Internet Explorer from Your Windows Application
        3. 34.3.1.3. Updating URLs and Page Titles
        4. 34.3.1.4. Creating a Toolbar
        5. 34.3.1.5. Showing Documents Using the WebBrowser Control
        6. 34.3.1.6. Printing Using the WebBrowser Control
    4. 34.4. Summary
  40. A. The Visual Basic Compiler
    1. A.1. The vbc.exe.config File
    2. A.2. Simple Steps to Compilation
    3. A.3. Compiler Output
      1. A.3.1. /nologo
      2. A.3.2. /utf8output[+:−]
      3. A.3.3. /verbose
      4. A.3.4. Optimization
        1. A.3.4.1. /filealign
        2. A.3.4.2. /optimize[+:−]
      5. A.3.5. Output files
        1. A.3.5.1. /doc[+:-]
        2. A.3.5.2. /netcf
        3. A.3.5.3. /out
        4. A.3.5.4. /target
      6. A.3.6. .NET assemblies
        1. A.3.6.1. /addmodule
        2. A.3.6.2. /delaysign[+:-]
        3. A.3.6.3. /imports
        4. A.3.6.4. /keycontainer
        5. A.3.6.5. /keyfile
        6. A.3.6.6. /libpath
        7. A.3.6.7. /platform
        8. A.3.6.8. /reference
        9. A.3.6.9. /vbruntime[+:-]
      7. A.3.7. Debugging and error-checking
        1. A.3.7.1. /bugreport
        2. A.3.7.2. /debug[+:-]
        3. A.3.7.3. /nowarn
        4. A.3.7.4. /quiet
        5. A.3.7.5. /removeintchecks[+:-]
        6. A.3.7.6. /warnaserror[+:-]
      8. A.3.8. Help
        1. A.3.8.1. /?
        2. A.3.8.2. /help
      9. A.3.9. Language
        1. A.3.9.1. /optionexplicit[+:-]
        2. A.3.9.2. /optionstrict[+:-]
        3. A.3.9.3. /optioncompare
        4. A.3.9.4. /optioninfer[+:-]
      10. A.3.10. Preprocessor: /define
      11. A.3.11. Resources
        1. A.3.11.1. /linkresource
        2. A.3.11.2. /resource
        3. A.3.11.3. /win32icon
        4. A.3.11.4. /win32resource
      12. A.3.12. Miscellaneous features
        1. A.3.12.1. /baseaddress
        2. A.3.12.2. /codepage
        3. A.3.12.3. /main
        4. A.3.12.4. /noconfig
        5. A.3.12.5. /nostdlib
        6. A.3.12.6. /recurse
        7. A.3.12.7. /rootnamespace
        8. A.3.12.8. /sdkpath
    4. A.4. Looking at the vbc.rsp File
  41. B. Visual Basic Power Packs Tools
    1. B.1. Visual Basic Power Packs
      1. B.1.1. Getting the Visual Basic Power Packs
    2. B.2. Using the Interop Forms Toolkit 2.0
      1. B.2.1. Creating a simple Interop Form
      2. B.2.2. Deployment
      3. B.2.3. Debugging
      4. B.2.4. VB6 development
      5. B.2.5. Final Interop Tips
    3. B.3. Using the Power Packs 2.0 Tools
    4. B.4. Summary
  42. C. Visual Basic Resources
    1. C.1. On the Web
    2. C.2. Books
    3. C.3. Author Blogs

Product information

  • Title: Professional Visual Basic® 2008
  • Author(s):
  • Release date: May 2008
  • Publisher(s): Wrox
  • ISBN: 9780470191361