Showing posts with label Visual Basic. Show all posts
Showing posts with label Visual Basic. Show all posts

Friday, February 3, 2012

Data Structures and Algorithms Using Visual Basic.NET (Cambridge, 2005)






Contents
Preface vii
Introduction 1
Chapter 1
Collections 14
Chapter 2
Arrays and ArrayLists 46
Chapter 3
Basic Sorting Algorithms 72
Chapter 4
Basic Searching Algorithms 86
Chapter 5
Stacks and Queues 99
Chapter 6
The BitArray Class 124
Chapter 7
Strings, the String Class, and the StringBuilder Class 150
Chapter 8
Pattern Matching and Text Processing 181
Chapter 9
Building Dictionaries: The DictionaryBase Class and the
SortedList Class 200
Chapter 10
Hashing and the HashTable Class 210
Chapter 11
Linked Lists 227
Chapter 12
Binary Trees and Binary Search Trees 249
Chapter 13
Sets 268
Chapter 14
Advanced Sorting Algorithms 283
Chapter 15
Advanced Data Structures and Algorithms for Searching 298
Chapter 16
Graphs and Graph Algorithms 320
Chapter 17
Advanced Algorithms 352
References 379
Index 381

Other Core of CS Books
Data Structures and Algorithm Analysis in C
Other Visual Basic Books
Visual Basic .NET and The .NET Platform An Advanced Guide
Other .NET Books
Introduction to Microsoft ASP.NET
Download

Monday, February 7, 2011

Developing Visual Studio .NET Macros and Add-Ins







Acknowledgments xiii
About the Author xv
Introduction xvii
Part 1 Automating Your Work 1
Chapter 1 All about Macros and Add-ins 3
What Are Macros and Add-ins? 4
Why Use Macros and Add-ins? 4
Automating Your Work with Macros 5
Enhancing the IDE with Add-ins 7
Online Help for Macros and Add-ins 8
Other Ways to Customize Visual Studio .NET 9
Manipulating the Windows 10
Managing the Toolbars and Commands 17
Customizing the Menus 22
Moving Forward 26
Chapter 2 Just Enough VB.NET 27
VB.NET Subroutines and Functions 29
VB.NET Variables 30
Arrays in VB.NET 34
Strings in VB.NET 36
VB.NET Control Structures 40
Conditional Statements 40
Loop Statements 41
Exceptions 43
Classes in VB.NET 44
Other VB.NET Topics 46
Moving Forward 48
Chapter 3 Introducing the Visual Studio Macro IDE 49
The Macro System and the Main IDE 49
Macro Development Divisions 51
Projects and Modules 51
Class Files and Code Files 53
Scoping 53
Working with the Macros IDE 54
The Parts of the Macros IDE 55
Managing Projects and Modules 56
Creating a New Project 57
Loading and Unloading Projects 57
Saving Your Project 58
Default Macro Location 59
Creating a New Module 59
Renaming Projects and Modules 59
Deleting a Module 60
Running a Macro 60
Stopping a Macro 61
Using the Code Editor in the Macros IDE 62
Collapsible Code 62
Working with Blocks of Code 63
Debugging a Macro 63
Working with the Macro Explorer 64
Quickly Recording a Temporary Macro 66
Selecting the Recording Project 67
Recording a Macro 67
Editing the Temporary Macro 68
Assigning Shortcut Keys to Your Macros 70
Moving Forward 71
Chapter 4 Macros That Interact with the User 73
Referencing Assemblies and Macro Projects 73
Referencing External Assemblies 74
Referencing Items in Other Macro Projects 75
Referencing One of Your Own Assemblies 77
Creating Windows and Forms 83
Getting Input from a User 83
Creating a Form 84
Displaying Standard Dialog Boxes 85
Working with System Event Handlers 87
Categories of Events 88
Moving Forward 93
Chapter 5 Just Enough .NET Architecture 95
Getting to Know Microsoft .NET 95
Common Language Runtime 96
.NET Class Library 97
Packaging Your Software: Assemblies and Manifests 98
Looking at an Assembly 99
Organizing Multiple Versions of an Assembly 100
.NET and OLE/COM 101
Globally Unique Identifiers 102
Building an Assembly from a COM Component 102
Macro and Add-in Models 103
Visual Studio Packages 104
Visual Studio Project Types 104
Accessing Project Types Not Supported by the Macros IDE 106
Accessing the Project Object 107
Accessing Visual Basic and C# Projects 108
Accessing C++ Projects 109
Macro IDE Automation Model 112
Moving Forward 113
Part 2 Enhancing Visual Studio 115
Chapter 6 Introducing Add-ins 117
About Add-ins 117
Startup and Shutdown 119
Invoking Your Add-in 120
Interacting with the IDE 121
Creating Custom Options Pages 123
Creating Tool Windows 124
Add-ins and the Command System 124
Wizards 125
Add-ins Are COM Components 126
Creating an Add-in 129
Using the Wizard 130
Building and Running the Add-in 136
Managing Add-ins 137
Moving Forward 138
Chapter 7 Creating Add-ins for the IDE 139
Building an Add-in in C++ 139
Including a GUI with Your Add-in 140
Working with Commands 141
Using the Forms Library 141
Building a Tool Window 145
Using the Form Designer with a Tool Window 153
Moving Forward 159
Chapter 8 Life Cycles, Debugging, and Satellite DLLs 161
The Life Cycle of an Add-in 161
Debugging an Add-in 162
Keeping the Registry Clean 163
Debugging the Command-Line Version 163
Debugging the Command-Line Add-in 164
Setting Up Multiple Debug Configurations 165
Creating a Satellite DLL for Resources 167
About Culture-Specific Information 168
Valid Culture Identifiers 169
Adding Culture-Specific Resources in .NET 170
Forms and Multiple Languages 170
Adding Cultural Assemblies in General 171
Making Your Add-ins Multilingual 175
Moving Forward 184
Chapter 9 Manipulating Solutions and Projects 185
Determining the Currently Selected Project 186
Manipulating a Project’s Items 188
Manipulating a Project’s Settings 193
Accessing and Setting Configuration Properties 195
Adding Configurations 198
Configuring Projects at the Solution Level 200
Configuring Individual Files 201
Manipulating Language-Specific Information 205
Moving Forward 206
Chapter 10 Programming the Document and User Interface Objects 207
Managing Documents with the Document Classes 207
The Form Editor and Documents 209
Opening or Creating a Document 210
Processing Text 212
The EditPoint, TextPoint, and VirtualPoint Objects 218
Working with Multiple Windows and Panes 221
Navigating the User Interface Hierarchy 223
Finding a Hierarchy Item 226
Finding an Item Using Regular Expressions 226
Selecting a Hierarchy Item 228
Collapsing Nodes 230
Moving Forward 231
Chapter 11 The CodeModel and Build Objects 233
Manipulating Code with the CodeModel 234
A FileCodeModel Add-in 237
Working with Build Objects 248
Spawning a Build Process 250
Building with the SolutionBuild Object 252
More on the SolutionBuild Object 252
Moving Forward 254
Chapter 12 Creating Project Wizards 255
Dissecting the Wizard Directory Structure 256
Wizard File Interactions and Symbols 259
Rendering the Template Files 263
Wizard Properties 267
A Script Wizard Tutorial 269
The common.js File 276
Viewing Your HTML Files 279
Moving Forward 281
Part 3 VS.NET and Other Products 283
Chapter 13 Writing .NET Add-ins for Microsoft Office 285
Introducing Office Add-ins 285
Writing Add-ins for Other Products 287
Preparing the Office Application 287
Creating the Add-in 288
Adding References to Office Products 291
Writing the Add-in 295
Debugging for Multiple Products 301
Responding to Office Events 303
Moving Forward 311
Chapter 14 Integrating Visual Studio .NET with Microsoft Office 313
Adding a Spelling Checker 314
Integrating an Excel Spreadsheet 322
Automating from Macros 326
Moving Forward 333
Chapter 15 Integrating with Other Products 335
Windows Script Host 335
Delphi 338
Python 340
Script Explorer Add-in 343
Moving Forward 352
Part 4 Deploying and Supercharging 353
Chapter 16 Deploying Your Macros and Add-ins 355
All about Security and Add-ins 355
.NET Security 356
Valid and Verified .NET Code 357
Security Permissions 357
Security Administration for .NET 358
Security in Action 359
COM Security 362
Deploying Macros 364
Setting Up the Deployment Project 365
Adding a Shortcut to the .vsmacros File 370
Creating the Custom Action Project 371
Moving Forward 375
Chapter 17 Supercharging Visual Studio .NET 377
Creating an Options Page for Your Add-in 377
Another Useful Add-in 388
Third-Party Add-ins 392
Exploring the CLI 393
Understanding the CLI 394
Other Languages and the CLI 394
Wrap-up 395
Appendix A Class and Object Quick Reference 397
Root DTE Object 397
DTE Properties 397
DTE Methods 400
Other EnvDTE Objects 401
Enumerations 402
Index 409

Another Visual Basic Books
Another .NET Books
Download

Friday, December 24, 2010

Programming Microsoft Visual Basic .NET for Microsoft Access Databases












by Rick Dobson ISBN:0735618194
Microsoft Press © 2003 (634 pages)
This book Provides programmers with the practical details they need to create or rewrite Microsoft Access–based client applications using Microsoft Visual Basic .NET and the Microsoft .NET Framework.

Companion Web Site


Table of Contents Back Cover
Table of Contents
Programming Microsoft Visual Basic .NET for Microsoft Access Databases
Introduction
Chapter 1 - Introduction to the .NET Framework
Chapter 2 - Using Visual Basic .NET with Visual Studio .NET
Chapter 3 - Visual Basic .NET Fundamentals
Chapter 4 - Selected Visual Basic .NET Advanced Topics
Chapter 5 - Fundamentals of Programming Windows Forms and Controls
Chapter 6 - Programming Windows Forms: Building on Fundamentals
Chapter 7 - ADO.NET: Concepts and Architecture
Chapter 8 - ADO.NET Coding Techniques
Chapter 9 - ADO.NET: Datasets and Data Manipulation on Windows Forms
Chapter 10 - Programming ASP.NET Pages
Chapter 11 - Implementing ADO.NET on ASP.NET Pages
Chapter 12 - Programming XML Web Services
Chapter 13 - Securing .NET Applications with Access Databases
Appendix - XML for Visual Studio .NET Access Developers
Index
List of Figures
List of Tables
List of Sidebars


Another Database Books
Another Visual Basic Books
Another .NET Books
Download

Tuesday, December 21, 2010

Mastering Visual Basic .NET













Contents at a Glance
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Part I • The Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 1 • Getting Started with VB.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2 • Visual Basic Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 3 • Visual Basic: The Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Chapter 4 • Writing and Using Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Chapter 5 • Working with Forms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Chapter 6 • Basic Windows Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Chapter 7 • More Windows Controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Part II • Rolling Your Own Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Chapter 8 • Building Custom Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Chapter 9 • Building Custom Windows Controls . . . . . . . . . . . . . . . . . . . . . . . 391
Chapter 10 • Automating Microsoft Office Applications . . . . . . . . . . . . . . . . . . 433
Part III • Basic Framework Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Chapter 11 • Storing Data in Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Chapter 12 • Handling Strings, Characters, and Dates . . . . . . . . . . . . . . . . . . . . 529
Chapter 13 • Working with Folders and Files . . . . . . . . . . . . . . . . . . . . . . . . . . 569
Part IV • Intermediate Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Chapter 14 • Drawing and Painting with Visual Basic . . . . . . . . . . . . . . . . . . . . 619
Chapter 15 • Printing with VB.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
Chapter 16 • The TreeView and ListView Controls . . . . . . . . . . . . . . . . . . . . . 741
Chapter 17 • Error Handling and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . 791
Chapter 18 • Recursive Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
Chapter 19 • The Multiple Document Interface . . . . . . . . . . . . . . . . . . . . . . . . 837
Part V • Database Programming with VB.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
Chapter 20 • Databases: Architecture and Basic Concepts . . . . . . . . . . . . . . . . . 869
Chapter 21 • Building Database Applications with ADO.NET . . . . . . . . . . . . . 925
Chapter 22 • Programming the ADO.NET Objects . . . . . . . . . . . . . . . . . . . . . 963
Part VI • VB.NET on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 997
Chapter 23 • Introduction to Web Programming . . . . . . . . . . . . . . . . . . . . . . . 999
Chapter 24 • Accessing Data on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1047
Chapter 25 • XML Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1099

Another .NET Books
Another Visual Basic Books
Download

Friday, December 17, 2010

Beginning Visual Basic .NET Databases













Who Is This Book For?
This book is for programmers with some basic experience of Visual Basic .NET, who want to begin
programming database applications.
It might be useful if you have some limited experience of Access, although this is not strictly necessary.
Note that this book is not an introduction to Visual Basic .NET. If you are completely new to Visual
Basic .NET, you will probably find Beginning Visual Basic .NET (Wrox Press, ISBN 1861004966) a better
choice to get you off the ground.
Likewise, this book is not aimed at getting experienced VB6 developers up to speed with the changes
between VB6 and Visual Basic .NET. If you fall into this category, try Professional VB.NET (Wrox Press,
ISBN 1861004974) instead.
What Does This Book Cover?
Visual Basic .NET is tightly coupled to very comprehensive and flexible data access technologies, so the
potential range of things that might fall under the title of this book is huge. Rather than trying to cover
too much, we have concentrated on providing a detailed introduction to the following strands:
❑ Basic database design principles.
❑ The SQL Server Desktop Engine.
❑ Querying the database using T-SQL.
❑ Using Visual Studio .NET's Server Explorer to run queries, views, stored procedures, etc.
❑ ADO.NET and the DataSet object.
❑ Reading data into the DataSet, binding it to a control on the user interface, changing data in
the DataSet, and saving those changes back in the underlying database.
❑ XML's role in ADO.NET.
❑ Internet database applications using Web Forms and Web Services.

What Do I Need to Use this Book?
All you'll need is a PC running:
❑ Windows 2000, XP, or NT4 Server.
❑ IIS 5, which comes with Windows 2000 and Windows XP.

❑ Internet Explorer.
❑ Access XP (or 2000).
❑ Visual Studio .NET Professional edition. (Higher versions of Visual Studio, e.g. the Enterprise
editions, should work fine too. However, at the time of writing, they were unavailable and so
this book was written using the Professional edition.)
❑ SQL Server 2000 Desktop Engine. This comes with Visual Studio .NET.
This book was written before the final release of Visual Studio .NET. If there are any
substantial changes between the instructions given in this book and those required to
work with the final release of Visual Studio .NET, we will provide free updates on the
Wrox online errata service.

Another Visual Basic Books
Another .NET Books
Another Database Books
Download

Thursday, December 16, 2010

Teach Yourself Database Programming With VB 5














Inroduction

Week 1 at a Glance

Day 1 Your First Database Program in Visual Basic 5

Day 2 Creating Databases

Day 3 Visual Basic Database Objects

Day 4 Creating Data Entry Forms with Bound Controls

Day 5 Input Validation

Day 6 Creating Reports with Crystal Reports Pro

Day 7 Using the Visdata Program
Week 1 in Review



Week 2 at a Glance

Day 8 Selecting Data with SQL

Day 9 Visual Basic and the Microsoft Jet Engine

Day 10 Creating Database Programs with Visual Basic Code

Day 11 Displaying Your Data with Graphs

Day 12 Data-Bound List Boxes, Grids, and Subforms

Day 13 Creating Databases with SQL

Day 14 Error Handling in Visual Basic 5
Week 2 in Review

Week 3 at a Glance

Day 15 Updating Databases with SQL

Day 16 Database Normalization

Day 17 Multiuser Considerations

Day 18 Using the Remote Data Control and the Remote Data Objects

Day 19 ODBC Data Access via the ODBC API

Day 20 Database Replication

Day 21 Securing Your Database Applications

Week 3 in Review

Appendix

Appendix A

Appendix B

Appendix C

Another Visual Basic Books
Another Database Books
Download

Saturday, November 27, 2010

Oracle Programming with Visual Basic













Introduction
Foreword
Acknowledgments
PART I—Introducing Oracle
CHAPTER 1—Oracle and Visual Basic
A Brief History of Oracle
The Architecture of a Relational Database
File-Based Systems
Client/Server Architecture
Multitier Architecture
Network Computing Architecture
Client
Application Server
Universal Data Server
The Oracle Server
Standard Features
Scalability
The Oracle Server Advanced Features
Distributed Databases
Parallel Server
Replication
Visual Basic in an Oracle World
The Past
The Present
The Future
Moving Up to Oracle
Moving from Microsoft Access
Moving from Microsoft SQL Server
Summary
CHAPTER 2—Oracle Database Architecture
Instances and Databases
Memory Structures
The Database Buffer Cache
Redo Log Buffer
Shared Pool
Library Cache
Data Dictionary Cache
Additional Memory Areas
Processes
Database Writer (DBWR)
Log Writer (LGWR)
System Monitor (SMON)
Process Monitor (PMON)
Archiver (ARCH)
Server Processes
Listener Process
Database Files
Control Files
Parameter File
Online Redo Log Files
Data Files
The Logical Structure
Data Concurrency and Data Consistency
Locking Strategies for Concurrency
How Is Consistency Achieved?
Schemas
Users
Tables
Indexes
Clusters
Sequence Generators
Procedures
Views
Synonyms
Tying It All Together: How Oracle Works
Summary
CHAPTER 3—Creating a Database
Administration Tools
SQL*Plus
Server Manager
NT Instance Manager
Oracle Enterprise Manager
Other Utility Programs
Oracle Installation
Services on NT
Oracle Database Assistant
Initialization Files
Starting Up and Shutting Down the Database
Starting Up a Database
Shutting Down a Database
Creating the Database
Rollback Segments
Temporary Tablespaces
Running the Script
Testing the Database
Your Default Users
Configuring the Network
Tnsnames.ora
Listener.ora
Operation of the Listener Process
Controlling the Listener Process
Summary
CHAPTER 4—Database Administration
Backup Procedures
Data Export and Impot
The Export Utility
The Export in Practice
The Impot Utility
Impot in Practice
Exports for Backups
Mirroring the Redo Logs
Adding New Log Files
Mirroring the Control Files
Ensuring the Archive Processes Are Active
Doing Hot Backups
Recovering a Database
Recovery Fundamentals
The Recovery
Setting Up Database Security
Creating Users
Using Operating-System Authentication
Assigning Privileges
System Privileges
Object Privileges
Granting Privileges
Using Roles
Predefined Roles
Stored Procedures to Enhance Security
Regular Maintenance Tasks
Daily
Weekly
Monthly
Using Enterprise Manager
Summary
CHAPTER 5—Database Design
The Conceptual Design
Entity-Relationship Diagrams
Adding the Attributes
Reviewing the Design
The Logical Design
Identifying the Record Types and Fields
Identifying Any Data Dependencies
Normalizing the Database
Ensure Attributes Are Atomic
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Higher Normalization Techniques
Simplifying the Design
De-normalizing the Database
Using Keys
Primary Keys
Surrogate Keys
Foreign Keys
Automating the Design Process
Summary
CHAPTER 6—Implementing a Database
Creating a Tablespace
Optional Parameters
Related Commands
Creating a Table
Oracle Data Types
Creating the Table at Last
Optional Parameters
Specifying the Storage Parameters
Related Commands
Expect Changes
Specifying Constraints
Column Constraints
Table Constraints
Implementing Referential Integrity
Specifying the Placement of Indexes
Creating Indexes
Creating and Using Sequences
Creating a Sequence
Optional Parameters
Maintaining a Sequence
Sequences in Practice
One Sequence Fits All
Many Sequences per Table
To Each Table Its Own Sequence
Audit Trails
Other Schema Objects
Clusters
Views
Synonyms
Setting Privileges
System Privileges
Object Privileges
Using Microsoft Database Designer
Database Diagrams
Creating Tables
Summary
PART II—Queries and Stored Procedures
CHAPTER 7—Queries
A SQL Overview
Types of SQL Commands
The Basic SELECT Command
SELECT Syntax
A Simple SELECT Statement
Narrowing the Selection
Sorting Your Results
Some Useful Operators
Calculated Columns
Oracle-Specific Functions
The DECODE Function
Group Functions
The GROUP BY Clause
The HAVING Clause
Queries from More Than One Table
Outer Joins
Subqueries
Subqueries That Return One Value
Subqueries That Return More Than One Row
Optimizing Your Queries
Efficient SELECT Statements
The Explain Statement
Specifying Schemas
Summary
CHAPTER 8—Updating Your Database
A Philosophy for Updating Tables
Inserting Rows
Single-Row Inserts
Multirow Inserts
Updating Rows
Deleting Rows
Transaction Control
Transaction Control in Action
Security
Database Triggers
Bulk Loading of Data
CREATE TABLE AS Subquery
SQL*LOADER
Roll Your Own
Dates and the Year 2000 Problem
Summary
CHAPTER 9—Introduction to PL/SQL
PL/SQL as an Extension of SQL
Stored Procedures
The Advantages of Stored Procedures
Procedure Structure
Function Structure
Trigger Structure
Procedure Parameters
Packages
Creating a Package
Built-In Packages
Tools for Creating a Stored Procedure
SQL*Plus
Executing the Script
Executing the Stored Procedure
Debugging Your Procedure
Visual Database Tools
Starting Up
Entering a Script
Executing a Procedure
Summary of Visual Database Tools
Oracle Procedure Builder
Using Procedure Builder
The Object Navigator
Creating a Local Program Unit
Running the Code with the PL/SQL
Interpreter
Handling Output Parameters
Debugging Your Procedure
The Stored Program Unit Editor
Error Handling in PL/SQL
Enhancing the Error Message
Summary
CHAPTER 10—Creating Stored Procedures
PL/SQL Data Types
Scalar Data Types
User-Defined (Composite) Variables
Declaring Variables
Using %TYPE and %ROWTYPE
Declaring Constants
Statements and Assignments
Flow Control Statements
Decision Flow Control
IF…THEN
IF…THEN…ELSE
IF…THEN…ELSIF
Loops
LOOP… END LOOP
WHILE…LOOP
FOR…LOOP
Using SQL Statements in PL/SQL
Update Statements
Using SELECT INTO
Exceptions in SELECT INTO
PL/SQL Cursors
Declaring a PL/SQL Cursor
Opening and Closing a PL/SQL Cursor
Fetching a PL/SQL Cursor
Error Conditions for PL/SQL Cursors
PL/SQL Cursors in Action
PL/SQL Cursor Loops
User-Defined Data Types
Records
PL/SQL Tables and Collections
Declaring a PL/SQL Table
Using a PL/SQL Table
Returning a PL/SQL Table to the Calling
Procedure
Implicit Loops for Tables
Cursor Variables
Declaring a Cursor Variable
Opening a Cursor Variable
Fetching Records
Closing the Cursor Variable
Passing Cursor Variables
Error Conditions
Using Triggers
Providing a Transaction Audit
Procedures and Visual Basic
Summary
PART III—Data-Access Technology
CHAPTER 11—Client-Side Technology
The Software Layers
The ODBC Driver Manager
The ODBC Driver
The OLE-DB Layer
The Oracle Call Interface
Net8 and SQL*Net
The Network Software
The Listener Process
Server Processes
Setting Up Net8 and SQL*Net
Making a Connection
Testing Your Network Setup
Potential Problem Areas
Failover Capabilities
ODBC
The Origins of ODBC
ODBC Drivers
ODBC Driver Categories
ODBC Conformance Levels
Selecting an ODBC Driver
Sources of ODBC Drivers
Microsoft ODBC Driver
Oracle ODBC Driver
Setting Up an ODBC Data Source
Creating an ODBC Connection String
Testing Your ODBC Connection
Potential Problems with the ODBC Setup
OLE-DB
OLE-DB Cursors
Cursors
Static Cursors
Dynamic Cursors
Keyset Cursors
Mixed Cursors
Firehose Cursors
How Cursors Work
Choosing a Cursor
Cursors in Action
Connections
Multiple Connections
DSN-less Connections
Closing an ODBC Connection
ODBC Connection Pooling
Oracle Multithreaded Server
Prestarted Connections
Alternative Access Methods
Oracle Precompilers
Oracle Objects for OLE
Summary
CHAPTER 12—Accessing Oracle from Visual
Basic
The JET Engine
Linked Tables
Linking an Oracle Table to Access
Typical Code
Data Access Objects
Features
Typical Code
Data Controls
Remote Data Objects
Features
Typical Code
ODBCDirect
Features
Typical Code
The ODBC API
Features
Disadvantages
Typical Code
ActiveX Data Objects
Features
Typical Code
Oracle Objects for OLE
Features
Typical Code
Comparison of Object Models
Exporting an Access Table to Oracle
Microsoft Access Export
Viewing an Exported Table in Oracle
Oracle Export Wizard
Summary
CHAPTER 13—Visual Basic Design Issues
Logging On to the Database
Views, Synonyms, and Schemas
Cursor Selection
Querying the Database
Updating the Database
Transaction Control
Using Visual Basic to Control Transactions
Using Oracle to Control Transactions
Using a Transaction Server
Locking Issues
Using BLOB-Type Data
Error Handling
Trapping Errors
Developing an Error Message
Logging Errors
Oracle Errors
Summary
CHAPTER 14—Data Access Objects
The DAO Object Hierarchy
DBEngine
Workspace
Groups and Users
Database
Accessing a Database
Database Object Properties
Creating Recordsets
Creating Updatable Recordsets
Creating Read-Only Recordsets
Recordset Properties
Exploring the Recordset Methods
Populating the Recordset
Changing the Current Record
Accessing the Fields of a Recordset
Changing the Records and Values in a
Recordset
Finding a Particular Record
Closing a Recordset
Using the GetRows Method
Executing SQL Commands
Calling Stored Procedures
Error Handling
Putting It All Together
Viewing the Structure of a Database
TableDefs
Fields
Indexes
A Practical Application of TableDefs
Drawbacks to DAO
Summary
PART IV—Advanced Oracle Techniques
CHAPTER 15—Remote Data Objects
The Object Hierarchy
rdoEngine
rdoEnvironments
rdoConnections
rdoResultsets
rdoQueries
rdoTables
Databases and Connections
Creating an rdoEnvironment Object
Creating a Connection
DSN-less Connections
rdoConnection Properties
rdoConnection Events
Working with rdoResultsets
Creating Updatable Result Sets
Creating Read-Only Result Sets
Scrollable Result Sets
Forward-Only Result Sets
Using rdoResultset Events
Exploring rdoResultset Methods and Properties
Populating the rdoResultset
Changing the Current Row
Accessing the Fields of a rdoResultset
Changing the Rows and Values in a
rdoResultset
Finding a Particular Row
Fetching Multiple Rows
Closing a rdoResultset
Using rdoQuery Objects
Executing SQL Commands
Calling Stored Procedures
Calling PL/SQL Functions
Asynchronous Operation
Checking for Completion
Using Events
Asynchronous Operation in Practice
Retrieving PL/SQL Tables
Error Handling
Putting It All Together
Viewing the Structure of a Database
rdoTables
rdoColumns
Indexes
Disadvantages of RDO
The Future of RDO
Summary
CHAPTER 16—ODBCDirect
The ODBCDirect Object Hierarchy
DBEngine
Workspace
Database
Connection
Accessing ODBCDirect
Making the Connection
Creating Recordsets
Using QueryDefs
QueryDef Properties
Calling Stored Procedures
Asynchronous Operations
Drawbacks to ODBCDirect
Summary
CHAPTER 17—ActiveX Data Objects
The ADO Object Model
Connection
Recordset
Command
Parameter
Field
Error
Property
Connecting to Oracle
OLE-DB Provider for ODBC
Native OLE-DB Provider for Oracle
Connection Events
Working with Recordsets
Other Ways to Create Recordsets
Exploring Recordset Methods and Properties
Populating the Recordset
Fetching Multiple Rows
Changing the Current Row
Accessing the Fields of a Recordset
Changing the Rows and Values in a
Recordset
Finding a Particular Row
Closing a Recordset
Recordset Events
The Command Object
Command Parameters
Executing SQL Commands
Calling Stored Procedures
Calling PL/SQL Functions
Retrieving PL/SQL Tables
Putting It All Together
Asynchronous Operation
Looking at the Database Structure
The OpenSchema Method
Error Handling
Using the Data Environment
Drawbacks to ADO
Summary
CHAPTER 18—Oracle Objects for OLE
The Oracle Objects for OLE Object Hierarchy
OraClient
OraSession
OraConnection
OraDatabase
The Early Binding Issue
Accessing a Database
Database Object Methods
Creating OraDynasets
Making Use of Triggers
Tuning the OraDynaset
OraDynaset Properties
Exploring the OraDynaset Methods
Populating the OraDynaset
Changing the Current Record
Accessing the Fields of an OraDynaset
Changing the Records and Values in an
OraDynaset
Finding a Particular Record
Closing a Dynaset
Using Parameters
Executing SQL Commands
Calling Stored Procedures
Retrieving Cursor Variables
Calling PL/SQL Functions
Retrieving PL/SQL Tables
Using OraSQLStmts
Batch Updates
Error Handling
Putting It All Together
Viewing the Structure of a Database
Drawbacks to OO4O
Summary
Epilogue
Index

Download
Another Visual Basic Books
Another Database Books

Friday, November 26, 2010

Developing Microsoft .NET Controls with Microsoft VB.NET














The Move to Object-Oriented Programming

As Visual Basic evolved, some object-oriented capabilities were added along the way, and arguments raged about whether the lack of this or that feature made Visual Basic less than a “pure” object-oriented language. Well, no more. Visual Basic .NET has emerged as a first-class player in the .NET arena. While Visual Basic .NET has taken its place among the pantheon of purely object-oriented languages (as are all languages that .NET supports), the story of how we got here has its share of ironic twists.

You’re obviously reading this book not only to learn how to use the intrinsic Windows and ASP.NET controls in Visual Basic .NET more effectively but also to find out how to build your own custom controls using object-oriented programming. There are many reasons—almost all of them valid—why Visual Basic has evolved over the years to finally become purely object oriented. But we’re not using classes, inheritance, polymorphism, and encapsulation just because object-oriented programming (OOP) is the be-all and end-all of paradigms. While OOP is compelling and a productivity enhancer, consider that this methodology has been in the mainstream for over two decades. Until recently, however, OOP never really reached the critical mass of programmers required to become the default way to write applications. After all, it’s difficult to argue with the 3.5 million classic Visual Basic programmers whose language wasn’t object oriented yet who continued to build world-class programs. These Visual Basic devotees made classic (non-OOP) Visual Basic the most popular language on the planet for building new programs.

If we examine Visual Basic’s meteoric rise in popularity, we see that even though classic Visual Basic wasn’t a pure OOP language, many parts of Visual Basic were actually much more reusable than those written in “pure” OOP languages. Not only that, it was still easier and faster to develop applications using Visual Basic than any competing language. In short, classic Visual Basic accomplished what OOP languages promised but never fulfilled in a large scale: true reusability. So how did we all make this giant step to pure OOP? I think this revolution happened largely because of one feature: controls. Let me explain.

Ironically, it was non-object-oriented Visual Basic that was ultimately responsible for bringing OOP to most programmers. For over 30 years, programmers were hearing about the dire straits of programming. Programs were getting too complex. There were not enough good programmers to go around. Large projects were constantly behind schedule and over budget, and many were canceled because they collapsed under their own weight. OOP emerged from academia and promised to help U.S. businesses with code reusability. In the mid-1980s, C++ made its debut, with the siren song of code reusability—the Holy Grail of programming. Unfortunately, in practice this was not to be for the mainstream of program development for several reasons.

In corporate development circles in the 1970s and 1980s, every time a certain piece of code was required, such as a calendar function, a programmer would typically write it from scratch. This approach was obviously costly and time-consuming. All the mainstream computer literature in the mid-1980s cited the object-oriented approach of C++ as the silver bullet for software development. A programmer would be able to write a functional calendar object once, and when this common object was needed in the next programming project, the coder could simply plug the coded and tested object into the next project.

In 1986, Cox and Novobilski coined the term Software-IC (Integrated Circuit) in the first edition of their book Object Oriented Programming: An Evolutionary Approach. Their idea was that just as you plug in a chip on a circuit board, you could plug in a software object, such as a calendar, in an application and build from there. It sounded too good to be true, and unfortunately it was in many cases.

Today when we think of OOP, we think reusability. However, this was not always the case. For example, in 1987, Bjarne Stoustrup (the inventor of C++) and Brad Cox (the inventor of Objective-C) debated the problem of large-scale component exchange. When pressed, both men agreed that the appropriate scope for reuse of C++ modules was probably at the project or even the departmental level, certainly not the plug and play first envisioned for the application level.

So what went wrong? Typically, what would happen in the real world is that a programmer would initially write a calendar object, and that tested and debugged object would be given to the next team for a new project. Instead of reusing that object, however, the new team would say something like, “Hmm, you know we need to have all holidays show up in red. We also need a feature that will alert us to all holidays.” The original calendar object didn’t have these features, so the programmers would inherit the original control and add the functionality needed to the object for that particular project. This inevitably meant inheriting from the original object, adding additional functionality, and thereby creating a new and different object. This new object required performing another round of regression testing, writing new documentation, and so forth. Although you could argue that if the original designers had completely thought out the original calendar, refining it wouldn’t have been an issue. However, the cycle of revisions and retesting often occurred with each new project. Because of this kind of tinkering, the ultimate goal of code reusability inside a corporation was never achieved in practice on any wide scale. While the Microsoft Foundation Class Library (MFC) greatly assisted in the process for C++, all of the above issues still generally applied.

Another problem was that learning to program in C++ was just flat out difficult. A decent programmer needed at least four to six months just to become functional in the language and another six months to become productive. Good C++ programmers were both scarce and expensive. Many other programmers tried and failed to grasp the abstract language.

Providing application programmers with controls such as text boxes for entering strings was a mind-bending idea when it debuted in Windows 1.0 in 1985. From the outside, things haven’t changed much. A button in .NET looks very much like a button from almost 20 years ago. But the original controls were child controls that communicated with their container via Windows messages, which proved unwieldy because not enough was hidden from the programmer. When the Visual Basic 1.0 16-bit VBX controls were unveiled at the 1991 Windows World conference in Atlanta, they were immediately seen as simple to use and took the software development community by storm. Not only was this new language several orders of magnitude easier to learn than C++, but it was also fun to program with. But the real reason Visual Basic wowed the programming world when it debuted was because the software contained 16 (16-bit) VBX controls that shipped with the product. Now you could draw a text box on a form, set some properties, and have a working Windows program.

Soon Windows morphed from 16 bits to 32 bits, and the controls switched from VBX to OLE custom controls. Microsoft marketing thought the name OLE was too geeky and not sexy enough, so the controls were rechristened ActiveX. ActiveX controls felt and smelled like VBX controls, but under the hood everything was based on the component object model (COM). The difficulty of writing these ActiveX controls was inversely proportional to their ease of use. The Windows operating system didn’t have any plumbing for these, and everything had to be written from scratch. And since COM didn’t support inheritance, there was a built-in dead end. Developers couldn’t extend the functionality—they had to make do with what was provided.

The original 16 VBX controls were off-the-shelf components that shipped with Visual Basic version 1.0, and they allowed developers to write real applications in a hurry. Writing a program quickly in C++ was an oxymoron. Although C++ is object oriented, it also involves complex concepts that programmers have to understand: not only classes and objects, but also Windows internals, message loops, and memory management. Visual Basic developers would have none of that. They could easily create applications by arranging a few controls on a form, edit the control’s properties, and write surprisingly few lines of code to complete a useful and working program. C++ programmers took time out from wrestling with pointers and memory leaks to scoff at Visual Basic programmers because they were using a “toy language.”

As it turned out, for many projects Visual Basic was better than C++, for a variety of reasons. Visual Basic operated at a much higher (and consequently more abstracted) level than C++. In C++, you had to completely define a form, which included setting style bits, and then register it with Windows. In Visual Basic, the form was just there by default.

When all is said and done, the whole purpose of OOP is to make programming easier and allow the developer to be more productive. If something makes your work easier, you should usually use it. If it makes your life more complicated, you should avoid it because in the long run it will ultimately cost you considerably more than not using it. Although C++ was compiled and therefore sometimes ran faster than the interpreted Visual Basic, the incremental increase in hardware speed over time ultimately made this point moot. And third-party plug-in controls were available to take care of the things that couldn’t be accomplished in Visual Basic.

Another irony is that the very 16 controls that made Visual Basic 1.0 a superstar had to be written in C++ or C because Visual Basic just didn’t have the capability. But these controls could then be hosted in a Visual Basic form. Many Visual Basic programmers learned C++ just so they could author controls.

As we know, OOP rests on the three-legged stool of inheritance, polymorphism, and encapsulation. Inside the controls this was true. But when a Visual Basic programmer drew a control on a form, it was quickly noted that to the user the control only provided encapsulation. The control was a black box of functionality—its implementation was completely hidden to the outside world.

For example, a button control was born knowing how to respond to a mouse click and a mouse-over. The programmer simply wrote code against these events. Bringing up the property box permitted the programmer to set the button’s caption property. It was the 16-bit VBX Controls that permitted Visual Basic programmers to be immediately productive—usually orders of magnitude more productive than the best C++ programmer. The single leg of the OOP stool, encapsulation, ignited the controls market.


Download
Another .NET Books
Another Visual Basic Books

Sunday, November 14, 2010

Visual Basic .NET Developer's Guide











From the Series Editor xxxi
Chapter 1 New Features in Visual Basic .NET 1
Introduction 2
Examining the New IDE 3
Cosmetic Improvements 3
Development Accelerators 5
.NET Framework 6
A Very Brief and Simplified History 6
.NET Architecture 7
ASP.NET 7
Framework Classes 8
.NET Servers 8
Common Language Runtime 8
History 8
Convergence 9
Object-Oriented Language 10
Object-Oriented Concepts 10
Advantages of Object-Oriented Design 11
History of Object Orientation and VB 13
Namespaces 13
Web Applications 13
Web Applications Overview 13
Web Forms 14
Web Services 15
HyperText Transport Protocol 16
Simple Object Access Protocol 17
Security 17
Type Safety 18
Casting 18
Data Conversion 19
Bitwise Operations 20
New Compiler 20
Compiling an Executable 20
Architecture 21
File Management in Previous Versions of VB 21
File Management 22
Changes from Visual Basic 6.0 23
Variants 23
Variable Lower Bounds 23
Fixed Length Strings 23
NULL Propagation 23
Other Items Removed 24
Function Values 24
Short Circuits 25
Properties and Variables 25
Variable Lengths 25
Get and Set 26
Date Type 26
Default Properties 27
Summary 28
Solutions Fast Track 28
Frequently Asked Questions 31
Chapter 2 The Microsoft .NET Framework 33
Chapter 3 Installing and Configuring VB.NET 91
Chapter 4 Common Language Runtime 145
Chapter 5 .NET Programming Fundamentals 171
Chapter 6 Advanced Programming Concepts 219
Chapter 7 Creating Windows Forms 269
Chapter 8 Windows Forms Components and Controls 347
Chapter 9 Using ADO.NET 409
Chapter 10 Developing Web Applications 459
Chapter 11 Optimizing, Debugging, and Testing 523
Chapter 12 Security 553
Chapter 13 Application Deployment 615
Chapter 14 Upgrading Visual Basic Applications to .NET 647
Index 713


Download

Another Visual Basic Books
Another .NET Books


Wednesday, November 10, 2010

101 Microsoft Visual Basic .NET Applications












by Sean Campbell, Scott Swigart, Bob Carver et al. ISBN:0735618917
Microsoft Press © 2003 (561 pages)

This guide provides expert, behind-the-code commentary on 101 fully executable code samples—distilling more than 700 hours of programming time into best practices for Microsoft Windows Forms development.
Has companion web siteCompanion Web Site
Table of Contents
101 Microsoft Visual Basic .NET Applications
About the Applications
Chapter 1 - Working with Microsoft Visual Studio .NET 2003 and Microsoft .NET Framework 1.1
Chapter 2 - Working with the Microsoft Visual Basic .NET Language
Chapter 3 - Data Access
Chapter 4 - Building Windows Forms User Interfaces
Chapter 5 - Building Web Applications
Chapter 6 - Working with Console Applications
Chapter 7 - Interacting with the Operating System
Chapter 8 - Working with the .NET Framework
Chapter 9 - Advanced .NET Framework
Chapter 10 - GDI+
Chapter 11 - Building Enterprise Services Applications
Chapter 12 - COM Interop/PInvoke
Chapter 13 - Visual Studio .NET
Chapter 14 - Securing Applications
Chapter 15 - Coding Conventions
Chapter 16 - Windows Server 2003 for .NET Developers
Index
List of Figures
List of Tables
List of Sidebars

Download
Another Visual Basic Books
Aother .NET Books

Monday, November 8, 2010

Visual Basic .NET The Complete Reference












Chapter 1: Software Development and Visual Basic .NET..........................................................................17
Overview..............................................................................................................................................17
Visual Basic and the Difficulty of Developing Software.....................................................................17
Reducing Complexity and Time−to−Market with Reuse..............................................................18
Software Development and Software Engineering...............................................................................18
The Classic Programming Models........................................................................................................19
Structured Programming......................................................................................................................20
Bug−Reduced Code........................................................................................................................21
Divide and Conquer........................................................................................................................21
Reuse.............................................................................................................................................21
Teaming.........................................................................................................................................22
Structural Nada?............................................................................................................................22
Object−Based Programming..........................................................................................................22
Object−Oriented Software Development..............................................................................................22
Real−World Reflections......................................................................................................................24
What Makes a Pure Object−Oriented Language..................................................................................25
Just Classes....................................................................................................................................25
Classes for Modularity, Cohesion, and Coupling...........................................................................26
Classes for Abstraction...................................................................................................................27
Classes for Encapsulation...............................................................................................................27
Classes for Hiding Information......................................................................................................27
Classes for Classification...............................................................................................................28
Class that Beget Classes: Inheritance.............................................................................................29
Classes for Objects: Instantiation...................................................................................................29
Classes for Association, Aggregation, and Composition...............................................................29
Classes for Events.........................................................................................................................30
Classes for Message Passing..........................................................................................................30
Classes for Polymorphism..............................................................................................................30
Classes for Interfaces.....................................................................................................................31
Frameworks..........................................................................................................................................31
Patterns.................................................................................................................................................32
Observations........................................................................................................................................33
Chapter 2: Visual Basic .NET and the .NET Framework............................................................................34
Overview..............................................................................................................................................34
Getting to Know the Framework's Runtime.........................................................................................35
The Common Type System............................................................................................................35
The Common Language Specification...........................................................................................36
The Common Language Runtime.........................................................................................................38
Microsoft Intermediate Language..................................................................................................40
Metadata........................................................................................................................................41
Executable Code............................................................................................................................42
Managed Execution.......................................................................................................................42
Side−by−Side Execution................................................................................................................44
Application Domains......................................................................................................................44
Automatic Memory Management..................................................................................................45
Just−in−Time Deployment.............................................................................................................46
Understanding Assemblies....................................................................................................................47
Locating Assemblies, Anytime......................................................................................................48
What's in an Assembly...................................................................................................................49
The Roles of the Assembly............................................................................................................53
Attributes, Reflection, and Assemblies..........................................................................................55
Strong Names................................................................................................................................55
The .NET Security Model.....................................................................................................................56
Observations........................................................................................................................................58
Part II: Visual Basic .NET Fundamentals.....................................................................................................60
Chapter List...........................................................................................................................................60
Chapter 3: The Visual Basic .NET Development Environment..................................................................61
Overview..............................................................................................................................................61
Working with the Visual Studio IDE....................................................................................................61
Navigating the IDE.........................................................................................................................62
Starting from the Start Page...........................................................................................................69
Creating a Visual Basic .NET Solution................................................................................................72
Loading the Vb7cr Solution...........................................................................................................73
Creating a New Project...................................................................................................................73
Solution Directory Structure..........................................................................................................76
File Extensions..............................................................................................................................76
Working with the Base−Class Library...........................................................................................77
A Minimal Visual Basic .NET Application...................................................................................80
Observations........................................................................................................................................82
Chapter 4: The Elements of Visual Basic .NET............................................................................................83
Overview..............................................................................................................................................83
Visual Basic .NET: The Foundation.....................................................................................................83
Lexical Elements...........................................................................................................................83
Preprocessing Directives................................................................................................................84
General Concepts..........................................................................................................................84
Option, Impots, and Namespaces Directives................................................................................84
Types.............................................................................................................................................85
Type Members...............................................................................................................................85
Statements and Statement Blocks...................................................................................................86
Expressions....................................................................................................................................86
Operators.......................................................................................................................................87
Visual Basic .NET Mini Style Guide....................................................................................................88
Naming and
Notation.....................................................................................................................88
Hungarian Notation.......................................................................................................................89
Word Choice..................................................................................................................................90
Getting Started.....................................................................................................................................90
Character and Lines........................................................................................................................91
Statements and Blocks....................................................................................................................95
Nothing for Nothing or Something for Nothing.............................................................................96
Classes, Types, and Objects: What's the Difference?...........................................................................97
Classes: The View from Above............................................................................................................98
The Class Declaration Space..........................................................................................................99
The Directive Space.....................................................................................................................102
The Implementation Space...........................................................................................................109
Elemental Value Types................................................................................................................110
Working with Numbers.......................................................................................................................112
Integer Types...............................................................................................................................112
Visual Basic 6 to Visual Basic .NET...........................................................................................113
Point Types........................................................................................................................................113
Characters..........................................................................................................................................114
Booleans.............................................................................................................................................114
Literal Notation..................................................................................................................................115
Type Conversion................................................................................................................................118
Working with Variables and Constants..............................................................................................120
Variable and Constant Declaration Shorthand.............................................................................124
Default Initialization....................................................................................................................125
Keeping Data Private....................................................................................................................126
Scope...........................................................................................................................................128
Variable and Constant Lifetimes..................................................................................................129
Observations......................................................................................................................................131
Chapter 5: Visual Basic .NET Operators....................................................................................................133
Overview............................................................................................................................................133
What an Operator Does.......................................................................................................................133
Numbering Systems Reviewed...........................................................................................................134
Positional Notation.......................................................................................................................135
Converting from One System to Another.....................................................................................136
Operator Precedence..........................................................................................................................138
Changing Precedence Order with Parenthesis..............................................................................139
Unary Operators.................................................................................................................................140
Arithmetic Operators.........................................................................................................................141
Assignment Operators........................................................................................................................141
Comparison Operators.......................................................................................................................143
Concatenation Operator......................................................................................................................144
Logical Operators...............................................................................................................................144
Logical And, Or, and Xor.............................................................................................................145
Short−Circuit Logical Operators..................................................................................................146
Bitwise Operators...............................................................................................................................147
Flag Sets.......................................................................................................................................148
Shifting Bits..................................................................................................................................150
Specialized Operators........................................................................................................................154
Is..................................................................................................................................................155
Like..............................................................................................................................................155
Operator Overloading........................................................................................................................156
Exceptions Referenced in this Chapter...............................................................................................158
Observations......................................................................................................................................158
Chapter 6: Software Design, Conditional Structures, and Control Flow.................................................159
Overview............................................................................................................................................159
Control Structures..............................................................................................................................160
Control Flow......................................................................................................................................160
Fully Sketched Code...........................................................................................................................162
Step−Form Notation.....................................................................................................................162
Pseudocode..................................................................................................................................162
Nassi−Schneiderman Charts........................................................................................................162
Flowcharts...................................................................................................................................163
Design Pitfalls.............................................................................................................................164
Conditional Statements......................................................................................................................165
If..................................................................................................................................................165
Else..............................................................................................................................................168
Else If..........................................................................................................................................168
Tips for Else and Else If...............................................................................................................169
Select Case..................................................................................................................................171
GoTo............................................................................................................................................173
On Error........................................................................................................................................174
Loops.................................................................................................................................................174
DoLoop........................................................................................................................................174
For. . . Next..................................................................................................................................175
For Each . . . Next.........................................................................................................................176
While...........................................................................................................................................177
One or the Other Conditional Functions.............................................................................................177
Choose.........................................................................................................................................177
IIF................................................................................................................................................178
Switch..........................................................................................................................................178
Pausing, Resuming, and Exiting Iteration..........................................................................................179
Exit Idiosyncrasies......................................................................................................................180
Observations......................................................................................................................................181
Chapter 7: Methods......................................................................................................................................182
Overview............................................................................................................................................182
What Is a Method...............................................................................................................................182
Types of Methods........................................................................................................................184
Synchronous vs. Asynchronous Method Calls.............................................................................184
Method Data.......................................................................................................................................185
Method Data: Global vs. Local....................................................................................................187
Local Declarations.......................................................................................................................188
Passing Arguments to Parameters................................................................................................190
Calling Methods..........................................................................................................................194
Function or Sub Methods.............................................................................................................196













Method Access Characteristics...........................................................................................................198
Public Methods.............................................................................................................................199
Protected Methods........................................................................................................................200
Friend............................................................................................................................................200
Protected Friend...........................................................................................................................200
Private Methods............................................................................................................................201
Controlling Polymorphism Characteristics of Methods...............................................................201
Mining the Framework's Methods......................................................................................................205
The Methods of System.Math.............................................................................................................206
Programming with the Math Class...............................................................................................208
Math−Related Exceptions............................................................................................................210
Properties...........................................................................................................................................211
Properties vs. Fields.....................................................................................................................213
Properties vs. Methods.................................................................................................................214
Introduction to Exception Handling....................................................................................................214
The Exception Handler.................................................................................................................216
Try Catch Blocks.........................................................................................................................217
Design and Construction of Methods.................................................................................................218
Class and Method Cohesion.........................................................................................................220
Method Coupling.........................................................................................................................222
The Length of a Method...............................................................................................................222
Recursive Design of Methods.............................................................................................................223
The Base Case.............................................................................................................................224
The Stopping Condition...............................................................................................................225
The Impact of Recursion..............................................................................................................226
Understanding Method Performance..................................................................................................227
Observations......................................................................................................................................231
Part III: Classes and Objects........................................................................................................................232
Chapter List.........................................................................................................................................232
Chapter 8: Types, Structures, and Enumerations......................................................................................233
Overview............................................................................................................................................233
The Value−Type Model......................................................................................................................233
How Value Types Work...............................................................................................................235
Boxing.........................................................................................................................................236
Why are Value Types Objects?....................................................................................................238
Structs and Enums Ahoy: Creating New Value Types................................................................239
Structures...........................................................................................................................................240
Structure Behavior.......................................................................................................................246
Enumerations.....................................................................................................................................248
Working with System.Enum........................................................................................................250
Flags............................................................................................................................................253
Final Words on Enums.................................................................................................................255
The Object−Reference Model.............................................................................................................256
Null Reference..............................................................................................................................261
What the Reference Refers To......................................................................................................262
The Object−Reference Model and Equality, Comparison, and Assignment...............................262
Observations......................................................................................................................................263
Chapter 9: Classes.........................................................................................................................................265
Overview............................................................................................................................................265
Getting the Semantics Correct............................................................................................................266
Of Classes and Types...................................................................................................................267
Semantics and Notation................................................................................................................267
Modeling............................................................................................................................................267
Software Modeling.......................................................................................................................268
Viewpoints...................................................................................................................................269
Unified Modeling Language........................................................................................................271
UML Diagrams............................................................................................................................272
UML Notation for Class Diagrams..............................................................................................273
UML Notation for Class Relationships........................................................................................274
Modularity.........................................................................................................................................274
Modularity Metrics: Coupling and Cohesion...............................................................................275
The Classes Are the System................................................................................................................275
Class Characteristics..........................................................................................................................278
In the Beginning Abstract Classes.....................................................................................................279
Factoring Out Commonality.........................................................................................................280
The Members of Abstract Classes................................................................................................281
Inheritance..........................................................................................................................................282
Inheritance and Polymorphism.....................................................................................................284
Inheritance and Coupling.............................................................................................................284
Multiple Inheritance....................................................................................................................285
Order and Control with Inheritance..............................................................................................286
Reduction of Complexity.............................................................................................................287
Maintenance................................................................................................................................288
Code Reuse..................................................................................................................................288
Implementing a Space Ship's Fuel Injector Software.........................................................................289
Instance Fields.............................................................................................................................290
Instance Constructors...................................................................................................................292
Properties.....................................................................................................................................293
Methods.......................................................................................................................................295
Publishing the ShuttleInjector Class.............................................................................................297
Activating the ShuttleInjector Class.............................................................................................298
The Inherited Members of Object.......................................................................................................300
Testing for Reference Equality with Equals.................................................................................300
ToString.......................................................................................................................................301
Cloning........................................................................................................................................302
GetHashCode...............................................................................................................................303
GetType.......................................................................................................................................303
ReferenceEquals..........................................................................................................................304
Finalize........................................................................................................................................304
Aggregation and Composition: Reuse by Containment.....................................................................304
More Aggregation at Work: A Form for Testing................................................................................308
Ending Inheritance with Sealed Classes.............................................................................................310
Improved Performance with Shared Classes and Modules.................................................................311
Observations......................................................................................................................................312
Chapter 10: Interfaces..................................................................................................................................313
Overview............................................................................................................................................313
Abstraction and Interfaces in Object−Oriented Software Design......................................................313
Getting Passionate (or Radical) about Interfaces................................................................................315
Interfaces and Inheritance............................................................................................................316
Realizing the Benefits of Interfaces.............................................................................................318
Implicit Interfaces..............................................................................................................................318
Explicit Interfaces..............................................................................................................................320
Abstract Class or Explicit Interface..............................................................................................321
An Introduction to Interface Design and Implementation..................................................................322
Accessing and Using the Implementation....................................................................................324
Compound Interfaces...................................................................................................................325
Designing and Defining Interfaces.....................................................................................................327
Interfaces, Once Published, Must Not Change.............................................................................327
Interface Invariance.....................................................................................................................327
Constructing the Interface............................................................................................................328
Getting Started with the Interface Definition...............................................................................329
Implementing Interfaces.....................................................................................................................331
Interface Implementation Semantics............................................................................................331
Implementing ICloneable.............................................................................................................332
Implementing IComparable..........................................................................................................333
Exceptions Covered in this Chapter....................................................................................................334
Observations......................................................................................................................................334
Chapter 11: Exceptions: Handling and Classes..........................................................................................336
Overview............................................................................................................................................336
Why Do We Need Exception Handling?............................................................................................337
Structured Exception Handling 101....................................................................................................337
Exception−Handling Models..............................................................................................................340
The Resumption Model................................................................................................................340
The Termination Model................................................................................................................340
Recovering from Exceptions...............................................................................................................341
Exception Statements.........................................................................................................................343
Try...............................................................................................................................................343
Catch............................................................................................................................................344
Finally..........................................................................................................................................348
When Filters................................................................................................................................349
Nesting Try Blocks.......................................................................................................................351
Throw..........................................................................................................................................352
Exception−Handling Tips...................................................................................................................357
Creating Your Own Exception Classes...............................................................................................358
The .NET Exception Hierarchy....................................................................................................358
Choosing a Base Class from which to Inherit..............................................................................359
Observations......................................................................................................................................362
Chapter 12: Collections, Arrays, and Other Data Structures...................................................................363
Overview............................................................................................................................................363
NET's Array and Collections Namespace...........................................................................................364
Specialized Collections................................................................................................................366
ICollection...................................................................................................................................366
IEnumerator and IEnumerable.....................................................................................................367
IList.............................................................................................................................................367
Stacks.................................................................................................................................................367
How to Program Against a Stack.................................................................................................371
Queues................................................................................................................................................372
How to Program Against a Queue................................................................................................374
Arrays.................................................................................................................................................376
The Array Class.................................................................................................................................377
Declaring and Initializing Arrays........................................................................................................378
Declaring Multidimensional Arrays...................................................................................................381
Jagged Arrays.....................................................................................................................................381
Programming Against Arrays.............................................................................................................382
The UBound Statement................................................................................................................383
Redeclaring Arrays.......................................................................................................................384
The Erase Statement.....................................................................................................................386
The IsArray Function...................................................................................................................386
Array Exceptions...............................................................................................................................386
Passing Arrays to Methods.................................................................................................................388
Receiving Arrays from Methods.........................................................................................................389
Searching and Sorting Arrays.............................................................................................................389
The BinarySearch Method............................................................................................................390
The Basics of Sorting Arrays.......................................................................................................392
Bubble Sort........................................................................................................................................393
Partition and Merge............................................................................................................................397
Quicksort............................................................................................................................................401
Sorting Strings and Other Objects......................................................................................................406
Populating Arrays..............................................................................................................................407
Arrays for Objects..............................................................................................................................407
Hash Tables........................................................................................................................................413
Observations......................................................................................................................................417
Chapter 13: Advanced Design Concepts: Patterns, Roles, and Relationships.........................................419
Overview............................................................................................................................................419
Designs on Classes.............................................................................................................................419
Singleton......................................................................................................................................420
Bridge..........................................................................................................................................423
Strategy........................................................................................................................................427
State.............................................................................................................................................429
Linked Lists and Trees........................................................................................................................433
Understanding the Linked List.....................................................................................................434
Designing a Base−Container Class for Lists (and Trees)............................................................436
Implementing the Node................................................................................................................437
Implementing the Container.........................................................................................................439
Implementing the Iterator.............................................................................................................456
Observations......................................................................................................................................458
Chapter 14: Advanced Interface Patterns: Adapters, Delegates, and Events..........................................459
Overview............................................................................................................................................459
Adapters and Wrappers.......................................................................................................................461
Interface Adaptation in ActionCOM− .NET Interop..........................................................................462
The Adapter Pattern in .NET..............................................................................................................465
The Adapter Pattern Event Model......................................................................................................470
Delegation: Please Help Me!..............................................................................................................471
Delegates............................................................................................................................................475
Understanding Delegates..............................................................................................................477
Declaring the Delegate.................................................................................................................477
Early Bound Delegate Declares...................................................................................................478
Late Bound Delegate Declares.....................................................................................................479
Sorting Data with Delegates...............................................................................................................481
Multicast Delegates............................................................................................................................484
The .NET Framework Event Model: Delegates and Events...............................................................485
Getting Ready to Wire−up: The Event Model in a Nutshell..............................................................489
Delegate Events vs. Adapter Events...................................................................................................490
Delegates vs. Function Pointers..........................................................................................................492
Observations......................................................................................................................................493
Chapter 15: Data Processing and I/O..........................................................................................................494
Overview............................................................................................................................................494
Data Processing..................................................................................................................................494
Working with Strings.........................................................................................................................495
Members of the String Class...............................................................................................................496
Clone...........................................................................................................................................496
Compare......................................................................................................................................497
CompareTo..................................................................................................................................497
Concat..........................................................................................................................................498
Copy............................................................................................................................................498
CopyTo........................................................................................................................................499
EndsWith, StartsWith...................................................................................................................499
Equals..........................................................................................................................................500
Format.........................................................................................................................................500
IndexOf, LastIndexOf..................................................................................................................501
Insert............................................................................................................................................501
Intern, IsInterned.........................................................................................................................501
Join, Split.....................................................................................................................................502
PadLeft, PadRight.......................................................................................................................503
Remove........................................................................................................................................503
Replace........................................................................................................................................503
SubString.....................................................................................................................................503
ToCharArray...............................................................................................................................504
ToLower, ToUpper.......................................................................................................................504
Trim, TrimEnd, TrimStart............................................................................................................504
Classic Visual Basic String Functions................................................................................................504
String Formatting...............................................................................................................................505
NumberFormatInfo......................................................................................................................506
DateTimeFormatInfo...................................................................................................................508
Custom Formatters......................................................................................................................510
Building Strings with StringBuilder...................................................................................................512
Capacity.......................................................................................................................................513
Append........................................................................................................................................513
AppendFormat.............................................................................................................................514
Insert............................................................................................................................................514
Remove........................................................................................................................................514
Replace........................................................................................................................................515
Regular Expressions...........................................................................................................................515
The .NET Framework Regex Metalanguage................................................................................517
File, Stream, and Text IO Operations.................................................................................................519
Files and Directories..........................................................................................................................520
The File Class..............................................................................................................................521
Path..............................................................................................................................................521
File Enumerations........................................................................................................................524
Basic File Class Operations..........................................................................................................527
Directory......................................................................................................................................529
The FileInfo Class........................................................................................................................530
DirectoryInfo...............................................................................................................................531
Using the Classic File System Object..........................................................................................532
FileSystemWatcher.....................................................................................................................534
Streams...............................................................................................................................................537
FileStream...................................................................................................................................538
SeekOrigin Enumeration..............................................................................................................542
BufferedStream...........................................................................................................................543
NetworkStream............................................................................................................................544
CryptoStream...............................................................................................................................544
MemoryStream............................................................................................................................544
Readers and Writers...........................................................................................................................545
Text Encoding.............................................................................................................................545
StringReader/StringWriter............................................................................................................546
StreamReader/StreamWriter........................................................................................................548
BinaryReader/BinaryWriter.........................................................................................................550
XML I/O............................................................................................................................................550
Reading XML Files......................................................................................................................550
Writing XML Files with XMLTextWriter...................................................................................554
Serialization with XML......................................................................................................................557
Activating Serialization at Run Time...........................................................................................560
Observations......................................................................................................................................561
Part IV: Writing Software with VB .NET...................................................................................................562
Chapter List.........................................................................................................................................562
Chapter 16: Interfacing with the End User.................................................................................................563
Overview............................................................................................................................................563
Windows Forms.................................................................................................................................565
A Form Is an Object.....................................................................................................................566
The System.Windows.Forms Namespace....................................................................................566
Automatically Generated Code....................................................................................................568
Introduction to Threading...................................................................................................................569
The User Interface and Thread Design.........................................................................................570
The .NET Framework's Thread Model........................................................................................571
Getting Started with Basic Threading..........................................................................................571
MDI Applications..............................................................................................................................573
Creating the MDI Parent..............................................................................................................573
Creating the MDI Children...........................................................................................................575
The Active Child..........................................................................................................................576
Arranging the Forms....................................................................................................................577
Delegating Application Startup and Shutdown............................................................................577
Keeping a Form on Top................................................................................................................578
Form Transparency......................................................................................................................578
Modality......................................................................................................................................579
Changing Borders........................................................................................................................580
Changing the Size of Forms.........................................................................................................581
Screen Location...........................................................................................................................581
Components and Controls...................................................................................................................583
Adding Components and Controls to Forms................................................................................583
Layout and Grouping....................................................................................................................584
Positioning Controls.....................................................................................................................588
Setting a Single Property for Multiple Controls...........................................................................589
Complex Property Pages..............................................................................................................589
Using The Property Grid..............................................................................................................590
Menus and Toolbars...........................................................................................................................590
Adding Menus and Menu Items Programmatically.....................................................................590
Context−Changing Menus............................................................................................................591
Enhancing Menus.........................................................................................................................593
The Menu Class...........................................................................................................................594
Responding to User Input...................................................................................................................594
Binding Events Dynamically........................................................................................................595
Hot Spots.....................................................................................................................................595
Mouse and Keyboard Events........................................................................................................596
Keyboard Events.........................................................................................................................597
Using a Timer to Fire Events.......................................................................................................597
Collecting User Input..........................................................................................................................597
Buttons.........................................................................................................................................597
Edit Text Boxes...........................................................................................................................598
Check Boxes................................................................................................................................600
Radio Buttons..............................................................................................................................601
Combo Boxes..............................................................................................................................601
DomainUpDown.........................................................................................................................601
NumericUpDown........................................................................................................................601
Date and Time Picker...................................................................................................................601
Calendar.......................................................................................................................................602
A Palette......................................................................................................................................602
List Boxes....................................................................................................................................602
CheckedListBox..........................................................................................................................602
ListView......................................................................................................................................603
Trackbars (Sliders).......................................................................................................................603
Toolbars.......................................................................................................................................603
TreeView.....................................................................................................................................603
Presentation and Informational Controls............................................................................................603
Labeling.......................................................................................................................................604
LinkLabel....................................................................................................................................604
Status Bar....................................................................................................................................605
Icons............................................................................................................................................605
PictureBox...................................................................................................................................605
ImageList.....................................................................................................................................605
Progress Bars...............................................................................................................................605
Grids............................................................................................................................................606
ToolTip........................................................................................................................................606
The ErrorProvider Control...........................................................................................................606
Help Provider..............................................................................................................................607
Printing Support..........................................................................................................................607
Drag and Drop....................................................................................................................................607
Dragging Data.............................................................................................................................607
Dropping Data.............................................................................................................................608
Using the Clipboard...........................................................................................................................609
Observation........................................................................................................................................609
Chapter 17: Getting Ready to Release.........................................................................................................610
Overview............................................................................................................................................610
Thinking in Debug Terms...................................................................................................................611
The System.Diagnostics Namespace..................................................................................................611
Enabling Debugging..........................................................................................................................615
Run−time Configuration Files............................................................................................................616
Machine Configuration File.........................................................................................................617
Application Configuration File....................................................................................................617
Security Configuration File..........................................................................................................618
Working with Configuration Files...............................................................................................618
Working with the Debug Class...........................................................................................................618
The Debug Write Methods...........................................................................................................619
Assertion......................................................................................................................................619
Fail...............................................................................................................................................622
Tracing and the Trace Class................................................................................................................623
Instrumentation............................................................................................................................623
Understanding the Phases of Code Tracing.................................................................................624
Listening to Your Code................................................................................................................624
Developer−Defined Listeners......................................................................................................627
Trace Switches............................................................................................................................627
Debugging with Visual Studio .NET..................................................................................................629
What Species Is Your Bug...........................................................................................................629
Debugging Aids...........................................................................................................................630
Breakpoints..................................................................................................................................631
Getting Started.............................................................................................................................632
The Visual Basic .NET Compiler.......................................................................................................635
Using a Response File for Compilation.......................................................................................637
Managing a Class Library from the Command Line....................................................................638
Conditional Compilation Directives.............................................................................................639
Observations......................................................................................................................................640
List of Figures.................................................................................................................................................641
Chapter 1: Software Development and Visual Basic .NET................................................................641
Chapter 2: Visual Basic .NET and the .NET Framework...................................................................641
Chapter 3: The Visual Basic .NET Development Environment.........................................................641
Chapter 4: The Elements of Visual Basic .NET.................................................................................641
Chapter 6: Software Design, Conditional Structures, and Control Flow............................................641
Chapter 7: Methods............................................................................................................................642
Chapter 8: Types, Structures, and Enumerations................................................................................642
Chapter 9: Classes..............................................................................................................................642
Chapter 10: Interfaces........................................................................................................................642
Chapter 12: Collections, Arrays, and Other Data Structures..............................................................642
Chapter 13: Advanced Design Concepts: Patterns, Roles, and Relationships....................................643
Chapter 14: Advanced Interface Patterns: Adapters, Delegates, and Events.....................................643
Chapter 16: Interfacing with the End User.........................................................................................644
Chapter 17: Getting Ready to Release................................................................................................644
List of Tables..................................................................................................................................................645
Chapter 2: Visual Basic .NET and the .NET Framework...................................................................645
Chapter 3: The Visual Basic .NET Development Environment.........................................................645
Chapter 4: The Elements of Visual Basic .NET.................................................................................645
Chapter 5: Visual Basic .NET Operators............................................................................................645
Chapter 6: Software Design, Conditional Structures, and Control Flow............................................646
Chapter 7: Methods............................................................................................................................646
Chapter 8: Types, Structures, and Enumerations................................................................................646
Chapter 9: Classes..............................................................................................................................646
Chapter 10: Interfaces........................................................................................................................646
Chapter 11: Exceptions: Handling and Classes..................................................................................646
Chapter 12: Collections, Arrays, and Other Data Structures..............................................................647
Chapter 15: Data Processing and I/O..................................................................................................647
Chapter 16: Interfacing with the End User.........................................................................................648
Chapter 17: Getting Ready to Release................................................................................................648
List of Sidebars...............................................................................................................................................649
Chapter 5: Visual Basic .NET Operators............................................................................................649
Chapter 7: Methods............................................................................................................................649
xiv


Download
Another Visual Basic Books
Another .NET Books
Related Posts with Thumbnails

Put Your Ads Here!