Home Page Icon
Home Page
Table of Contents for
Dedication
Close
Dedication
by Tim Patrick
Programming Visual Basic 2008
Programming Visual Basic 2008
Dedication
A Note Regarding Supplemental Files
Preface
Who Is Reading This Book?
What’s in This Book?
What’s in the Software Download?
Conventions Used in This Book
Using Code Examples
How to Contact Us
Safari® Books Online
Acknowledgments
1. Introducing .NET
Before .NET
Back to Introducing .NET
The .NET Object
Objects and Data
Objects and Interfaces
Objects and Instances
The Parts of the .NET Framework
The Common Language Runtime
The Common Language Specification
The Common Type System
.NET Class Libraries
Assemblies and Manifests
Metadata and Attributes
Versioning
From Source Code to EXE
What About Visual Studio and Visual Basic?
Visual Studio 2008
Summary
Project
2. Introducing Visual Basic
The History of the Visual Basic Revolution
Visual Basic from the Inside Out
The Basics of Logic and Data
Data Types and Variables
Literals
Variables
Value Types and Reference Types
Data Types
Advanced Declaration
Constants
Local Declaration and Fields
Intermission
Comments
Option Statements
Basic Operators
Using Functions and Subroutines
Conditions
If Statements
Select Case Statements
IIf and If Functions
Loops
For . . . Next Loops
For Each . . . Next Loops
Do . . . Loop Loops
Exit Statements
Continue Statements
Creating Your Own Procedures
Subroutines
Functions
Properties
Where to Put Your Procedures
Other Flow Control Features
The GoTo Statement
The Return Statement
The End and Stop Statements
Events and Event Handlers
Namespaces
Referencing Namespaces
Namespaces in Your Project
The My Namespace
Summary
Project
3. Introducing the Project
The Library Project
Library Item Features
Patron Features
Administrative Features
The Application As a Whole
The Needs of the Users
Data and Information
Process
Usability
Commonality
Project-Specific Needs
The Life of a Project
Project Kickoff
Documentation
Project Goals
Design and Planning
Project Approval
Software and Other Development
Changes to the Project
Acceptance Criteria Testing
Project Acceptance
Deployment and Distribution
Ongoing Support
Summary
Project
4. Designing the Database
Relational Databases
SQL Server 2005
SQL
DDL Statements
DML Statements
Beyond Basic SQL
Using Databases in Visual Basic
Documenting the Database
Summary
Project
Technical Resource Kit Content
Security-related tables
Activity
GroupName
GroupActivity
UserName
Support code tables
CodeAuthorType
CodeCopyStatus
CodeLocation
CodeMediaType
CodePatronGroup
CodeSeries
Library items
NamedItem
ItemCopy
Publisher
Author
ItemAuthor
Keyword
ItemKeyword
Subject
ItemSubject
Patron-related tables
Patron
PatronCopy
PatronPayment
Bar code-related tables
BarcodeSheet
BarcodeLabel
BarcodeLabelItem
Other miscellaneous tables
Holiday
SystemValue
Creating the Database
5. .NET Assemblies
What Is an Assembly?
What’s Inside an Assembly?
Reflection
Assemblies and Applications
The My Namespace and Assemblies
Directives and Assemblies
Summary
Project
Adding Controls
Adding the Code to the Form
Setting the Version Number
Adding the Main Form
Extra Credit: Adding an Icon
Save Your Work
6. Data and Data Types
The Nature of Computer Data
Data in .NET
Integer Data Types
Decimal Data Types
Character Data Types
Date and Time Data Type
Boolean Data Type
The System.Object Class
Value Types and Reference Types
Visual Basic Data Types
Literals
Constants
Enumerations
Variables
Scope and Lifetime
Variable and Constant Naming Conventions
Local Type Inference
Operators
Static Variables
Arrays
Multidimensional Arrays
Array Boundaries
Initializing Arrays
Nullable Types
Common Visual Basic Functions
Conversion Functions
Date-Related Functions
Numeric Functions
String Functions
Other Functions
Summary
Project
7. Windows Forms
Inside a Windows Application
Everything Is a Window
Messages and the Message Pump
Window Procedures
Windows in .NET
Forms and Controls
Designing Windows Forms Applications
Working with Forms
Adding Controls
Events and Delegates
Making Forms Useful
Summary
Project
Configuring the Splash Screen
Configuring the Main Form
Making the Program Single-Instance
8. Classes and Inheritance
Object-Oriented Programming Concepts
The Object
Abstraction
Encapsulation
Inheritance
Polymorphism
Interfaces and Implementation
OOP in Visual Basic and .NET
Classes
Class Members
Shared Class Members
Overloaded Members and Optional Arguments
Inheritance
Creating Instances of Classes
Constructors and Destructors
Interfaces
Modules and Structures
Partial Methods
Related Issues
The MsgBox Method
Using DoEvents
ParamArray Arguments
Summary
Project
Supporting List and Combo Boxes
Editing Code Tables
The Generic Detail Form
The Generic Summary Form
9. Functional Programming
Lambda Expressions
Implying Lambdas
Expression Trees
Complex Lambdas
Variable Lifting
Object Initializers
Error Handling in Visual Basic
The Nature of Errors in Visual Basic
Unstructured Error Handling
Disabling Error Handling
Ignoring Errors
Structured Error Handling
The Try Clause
The Catch Clause
The Finally Clause
Unhandled Errors
Managing Errors
Generating Errors
Mixing Error-Handling Methods
The System.Exception Class
The Err Object
The Debug Object
Other Visual Basic Error Features
Summary
Project
General Error Handler
Unhandled Error Capture
10. ADO.NET
What Is ADO.NET?
Overview of ADO.NET
Providers
Data Sets
Data Sets Versus No Data Sets
MARS Support
Connecting to SQL Server with Visual Studio
Creating a Data Source
Using a Data Source
Data Binding
Interacting with SQL Server in Code
Building the Connection String
Establishing the Connection
Using SQL Statements
Processing the Results
Modifying Data
Database Transactions
ADO.NET Entity Framework
Summary
Project
Reference the Data Namespaces
Connecting to the Database
Interacting with the Database
Processing Data Values
System-Level Configuration
11. Security
Security Features in .NET
Cryptography and Encryption
Keeping Secrets
Data Stability
Identity Verification
Encryption in .NET
Symmetric Cryptography
Asymmetric Cryptography
Hashing
Other Security Features
User Authentication and My.User
The SecureString Class
Summary
Project
Authentication Support
Encrypting Passwords
Undoing Some Previous Changes
Managing Security Groups
Managing Users
Per-User Experience
12. Overloads and Extensions
What Is Operator Overloading?
What Can You Overload?
Mathematical Operators
Comparison Operators
Bitwise and Logical Operators
The CType Operator
Other Operator Overloading Issues
Declaration Requirements
Overloading Overloads
Be Nice
Extension Methods
Summary
Project
Overloading a Conversion
Global Support Features
Extending a Framework-Supplied Class
Record Editors and Supporting Forms
Search-limiting forms
Keyword and subject editors
More named item support forms
Inherited code editors
Connecting the Editors to the Main Form
Setting the Default Location
13. XML
What Is XML?
The XML Rule
XML Content
Some Basic XML
Some Basic—and Meaningful—XML
What About the Human-Readable Part?
XML Schemas
XML Namespaces
Using XML in .NET: The Old Way
The Basic XML Classes, Basically
Finding Needles and Haystacks
Schema Verification
XML Transformations
Using XML in .NET: The New Way
Embedded XML Expressions
XML Axis Properties
Namespaces and Schemas for XML Literals
Summary
Project
Update Technical Documentation
Report Configuration File
Create Report Entry Class
Design the Report Form
Populate Reports from Configuration File
Running the Reports
Connecting the Select Report Form
14. Application Settings
A Short History of Settings
Settings in Visual Basic 2008
Adding Settings to a Project
My.Settings
Bound Settings
Summary
Project
Update Technical Documentation
User settings
Add the Settings
Positioning the Main Form
Caching and Using Settings
Adding Configuration Forms
Connecting to the Configured Database
15. Files and Directories
Traditional Visual Basic File Management
Manipulating Files Through Streams
Stream Features
Using a Stream
Beyond Stream Bytes
Reading a File Via a Stream
File Management with the My Namespace
My Namespace Versus Visual Basic Commands
Reading and Writing Files Through My
Summary
Project
Configuring Log Output
Other Log Output Options
Obtaining a Bar Code Font
16. Generics
What Are Generics?
Variations of Generic Declaration
Multiple Placeholders
Data Type and Interface Constraints
Simultaneous Constraints
Nesting Generic Types
Non-Generic Types with Generic Members
Overloading Generic Types and Members
Generics and Collections
Generic Nullable Types
Summary
Project
Managing Holidays
17. LINQ
What Is LINQ?
The Good
The Bad
Supporting Technologies
Anonymous Types
LINQ to Objects
Basic Query Expressions
The From Clause
The Select Clause
The Distinct Clause
The Where Clause
The Order By Clause
Joining Sources
Skip and Take
Converting Results to Other Forms
Aggregate Queries
Advanced Query Expressions
LINQ to XML
LINQ for ADO.NET-Related Data
LINQ to Entities
LINQ to DataSet
LINQ to SQL
Deferred Execution
Summary
Project
Looking Up Library Items
Maintaining Search History
Showing Item Detail
Enabling the Search Features
18. User Interface
Overview of GDI+
Selecting a Canvas
Obtaining and Creating Graphics Objects
Disposing of Graphics Objects Properly
Choosing Pens and Brushes
Pens
Brushes
Flowing Text from the Font
Imagining Images
Exposing Your True Artist
Paths: Drawings on Macro-Vision
Keeping It Regional
Twisting and Turning with Transformations
Enhancing Controls Through Owner Draw
Windows Presentation Foundation
WPF and XAML
Enhancing Classes with Attributes
Summary
Project
Install the Bar Code Font
Using Owner Draw
Bar Code Design
Fun with Graphics
19. Localization and Globalization
Defining Globalization and Localization
Resource Files
The My.Resources Object
Localizing Forms Within Visual Studio
Adding Resources Outside Visual Studio
Manually Compiling Resources
Resource File Generation
Compiling Satellite Assemblies
Other Localization Features
Summary
Project
Tracking Patron Payments
Calculating Patron Fines
Patron Record Access
Patron Password Modification
Collecting Patron Payments
Managing All Fines and Payments
Connecting Patron Features to the Main Form
Dueling Patron Management Forms
20. Printing
Printing in Windows
Printing in .NET
Printing a Document
Print Preview
Counting and Numbering Pages
Printing in “Raw” Mode
Summary
Project
Supporting Raw Printing
Printing Tickets
Printing Bar Codes
Renewal of Checked-Out Patron Items
Support for Check-In and Checkout
Checking Out Items
Checking In Items
21. Reporting
Report Options in .NET
PrintDocument-Based Printing
HTML/Web Pages
XPS Documents
Reporting Services and Controls
Crystal Reports
Integration with Microsoft Office
Using Reporting Controls in .NET
Adding the Data Source
Adding a Report Design Surface
Designing the Report Surface
Using a Report Control
Running the Report
Adding a Page Header and Footer
Support for Grouping and Sorting
Enhanced Style Formatting
Using Custom Data
Supplying Custom Data Sources
Summary
Project
Crafting the SQL Statements
Adding Report Schemas
Adding Reports
Adding a Report Viewer
Adding Built-in Reports
22. Licensing Your Application
Software Licensing Options
License Agreement Only
Generated General License Key
Generated Custom License Key
License Key with Hardware Identity or Lock
Controlled Access
License Agreements
Obfuscation
The Library Licensing System
Designing the License File
Generating the License File
Installing the License File
Using the License File
Summary
Project
Update Technical Documentation
License File
Library License Helper Application
Adding the License to the Library Program
Display the License on the About Form
Enforcing the License
Daily Item Processing
23. Web Development
How the Internet Works
Programming the Internet
ASP.NET Features
Trying Out ASP.NET
More About Events
State and View State
Data Validation
Database Integration
Windows Communication Foundation
Summary
Project
Configuring the Database
The Default Page
Search Results
Search Detail
Statistics Report
24. Adding Online Help
Windows Online Help Options
WinHelp
HTML Help
Microsoft Help 2
Assistance Platform
Other Methods
Designing HTML Help
Content Files
Help Project File
Help Contents File
Help Keywords (Index) File
Formatting Help Windows
Accessing HTML Help
HelpProvider Control
Accessing HTML help files
Showing pop-up help
ShowHelp Method
Summary
Project
Building the Help Files
Adding Help Support to the Application
25. Deployment
What’s Involved in Deployment?
Deployment Methods Within Visual Studio
Direct ASP.NET Deployment
XCopy Deployment
Windows Installer Deployment
Step 1
Step 2
Step 3
Step 4
Step 5
After the wizard
Generating the MSI file
ClickOnce Deployment
Summary
Project
Planning the Deployment
Building the Setup Project
The Distribution Media
26. Project Complete
The Library Project
Visual Basic Flexibility
The Programming Mindset
Summary
A. Installing the Software
Download the Software
Install the Software
Install Project Templates
Install Code Snippets
Bar Code Support
B. Software License Agreement
Terms of Use
Index
About the Author
Colophon
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Programming Visual Basic 2008
Next
Next Chapter
A Note Regarding Supplemental Files
Dedication
To Maki, my lovely wife
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset