Visual Basic Developer's Handbook: Evangelos Petroutsos Mark Ridgeway
Visual Basic Developer's Handbook: Evangelos Petroutsos Mark Ridgeway
Visual Basic Developer's Handbook: Evangelos Petroutsos Mark Ridgeway
®
Visual Basic .NET
Developer's Handbook™
Evangelos Petroutsos; Mark Ridgeway
Index
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved. No part of this
publication may be stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to
photocopy, photograph, magnetic or other record, without the prior agreement and written permission of the publisher.
ISBN: 0-7821-2879-3
SYBEX and the SYBEX logo are either registered trademarks or trademarks of SYBEX Inc. in the USA and other
countries.
TRADEMARKS: Sybex has attempted throughout this book to distinguish proprietary trademarks from descriptive terms
by following the capitalization style used by the manufacturer. Copyrights and trademarks of all products and services
listed or described herein are property of their respective owners and companies. All rules and laws pertaining to said
copyrights and trademarks are inferred.
This document may contain images, text, trademarks, logos, and/or other material owned by third parties. All rights
reserved. Such material may not be copied, distributed, transmitted, or stored without the express, prior, written consent
of the owner.
The author and publisher have made their best efforts to prepare this book, and the content is based upon final release
software whenever possible. Portions of the manuscript may be based upon pre-release versions supplied by software
manufacturers. The author and the publisher make no representation or warranties of any kind with regard to the
completeness or accuracy of the contents herein and accept no liability of any kind including but not limited to
performance, merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or alleged
to be caused directly or indirectly from this book.
Sybex Inc.
1151 Marina Village Parkway
Alameda, CA 94501
U.S.A.
Phone: 510-523-8233
www.sybex.com
Index
Note to the reader: Throughout this index boldfaced page numbers indicate primary discussions of
a topic. Italicized page numbers indicate illustrations.
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
942 ADOTransactions project—ASP.NET
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
ASP.NET impersonation—border, for custom control 943
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
944 Border3Dsize property, of SystemInformation object—CheckBoxList Web control
Border3Dsize property, of SystemInformation CAL (Client Access License), for SQL Server
object, 308 2000, 924
BorderSize property, of SystemInformation Calendar Auto Format dialog box, 606, 607
object, 308 Calendar mobile control, 887
BorderStyle property, of Splitter control, 305 Calendar Web control, 602, 606, 606–608
Bounds property, of PageSettings object, 388 Call Stack window for debugging, 451
<br> tag (HTML), 758 callback functions, 515–516, 519
Breakpoint Hit Count dialog box, 444, 444 Cancel button, 410
breakpoints, 441, 442–444 CancelCurrentEdit method, of Binding-
conditional, 444–445 ManagerBase class, 173, 183
Breakpoints window for debugging, 451 CanConvertFrom method, of Expandable-
Browsable attribute, of custom control ConverterObject class, 565
member, 554 CanConvertTo method, of Expandable-
Browse With dialog box, 238 ConverterObject class, 565
Build menu CanDuplex property, of PrinterSettings
➢ Build Contact, 540 object, 388
➢ Configuration, 439 CanHandlePowerEvent property, of Windows
business logic service, 584
application layer for, 215 CanPauseAndContinue property, of Windows
for mobile web application, in Code service, 584
Behind, 892 CanShutDown property, of Windows
in n-tier applications, 274–275 service, 584
in two-tier systems, 274 CanStop property, of Windows service, 584
Button HTML control, 604 CanUndo property, of TextBox control, 344
Button Web control, 602 Caption property, implementing, 546
CaptionColor property, implementing, 546–547
CaptionHeight property, of SystemInformation
C object, 308
Cascade setting for DataSet rules, 92
C++ component cascading style sheets, from Visual Studio,
for n-tier applications, 282–284 663–664
calling, 295 case sensitivity of XML, 638
setting Text property to, 292 Category attribute, of custom control
CAB file, 459 member, 554
cache management, 639–641 Cc property, of MailMessage class, 732
for application data, 640 chat application, 717–723, 718
output caching, 640–641, 689 CheckBox HTML control, 604
and performance, 642 CheckBox Web control, 602
ViewState, 641 CheckBoxList Web control, 603
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
CheckedListBox control—Columns collection 945
code to load XML data file contents into, 675 client certificates, 860
data binding to database, 748–754, 750 client/server applications, 214–215
vs. RadioButtonList control, 668 client-side controls, 605
CheckedListBox control, 346 Clip property, of Graphics object, 394
child forms in MDI application, 332 Clipboard Ring, 9, 659
accessing active, 337–338 clipboard, TextBox control methods for copy
MDIParent property of, 334 and paste, 345–346
ChildTable property, of DataRelation Close method
objects, 111 for connection, 66
Choose a ReportDocument dialog box, for of TcpClient class, 716
Crystal Reports, 780 CLR (Common Language Runtime), 11
chunking, 895 CLS (Common Language Specification), 13
Class keyword, 469 Code Behind view, 10
classes, 464–469. See also objects for n-tier applications, 278
building new, 469–503 code editor window
BookStore class, 482–487 brown dot in margin, 442
error handling, 477–479 line number display, 442
implementing properties, 470–477 code, non-interruptible block, 430
inheritance, 492–501 code snippets, Clipboard Ring to store, 9
inheritance modifiers, 501–503 COFF (Common Object File), 11
instance and shared members, Collate property, of PrinterSettings
479–492 object, 388
creating instance of, 465 Collect method, for garbage collection, 13
delegates, 515–528 Collection Editor, 561
inheritance, when to use, 508–509 Collection object, 465
interfaces, 503–515 collections
IComparable and IComparer interfaces, objects implementing, 510
509–513 properties, 484–490
IEnumerable, 513–515 Color property, of PageSettings object, 388
implementation, 25 ColumnChanged event, of DataTable
role in Visual Basic .NET, 464 object, 175
Clear method, 469 ColumnChanging event, of DataTable
Client Access License (CAL), for SQL Server object, 175
2000, 924 ColumnHeader Collection editor, 361, 361
client application ColumnHeader objects, 362
for distributed applications, 59 ColumnHeaderStyle enumeration, 360
for SQLXML Web service, 52–55 ColumnName property, of DataColumn object,
for XML Web service, 842–846 108, 126
Client Certificate Request, for SSL, 864 Columns collection, 362
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
946 columns in tables—constructors
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
container control—custom controls 947
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
948 custom type editors—data-bound Web controls
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
data cubes—DataGrid control 949
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
950 DataGrid Web control—DataSet object
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
DataSet property, of XmlDataDocument object—delegates 951
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
952 Delegates project—Dynamic Host Configuration Protocol (DHCP)
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
e-commerce application with ASP.NET—enumerations 953
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
954 enumerator, for collections—finding rows by ID
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
FindString method, of ListBox control—GetHostByAddress() method, of IPAddress class 955
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
956 GetHostByName() method, of IPAddress class—HTML page
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
HTML view—initial catalog attribute, of ConnectionString property 957
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
958 initializing objects, with constructors—IsValid property, of PrinterSettings object
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
Item property—ListBox Web control 959
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
960 ListBoxDemo project—members of class
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
memory—Mobile Web Form 961
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
962 modal form—names
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
namespace—objects 963
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
964 OLAP (Online Analytical Processing)—Parameters property, of Command object
vs. classes, 464 Options dialog box, Text Editor node, 442
garbage collection and, 13 original version of row in DataSet, 138, 140
initializing with constructors, 467–469 OuterXML property, of XMLDataDocument
sorting, 511. See also Sort method object, 830
vs. structures, 473 Outlook, 731
what it is, 466 output caching, 640–641, 689
OLAP (Online Analytical Processing), 927 Output window for debugging, 451
OLE DB-compliant databases, data provider overloading, 22–23
for, 61 methods, 473–474
OledbConnection object, creating, 66 Overridable keyword, 23, 502
On Error Goto statement, 17 Overrides keyword, 24, 503
OnContinue method, for Windows overriding, 23–24
services, 582 default class members, 490–492
OnCustomCommand event, for Windows owner-drawn menus, 323–326, 324
services, 589–590 OwnerDraw property, of menu item, 323
Online Analytical Processing (OLAP), 927
OnlineImages project, 713, 713–715
OnPaint event handler, overriding for custom P
control, 548–549
OnPause method, for Windows services, 582 <P> tag (HTML), 758
OnStart method, for Windows services, 582, pages, for SQL Server data storage, 926
584–585 PageSettings property, 385
OnStop method, for Windows services, 582, 585 PageSetupDialog control, 557
Opacity property, of form, 307 PageSize property, of DefaultSettings object,
Open method, for connection, 66 390, 393
OpenRead method, of WebClient class, pagination
703–704, 706 for DataSet display, 771–772
Openwave Generic Simulator, 881 for mobile web application, 895, 913
Openwave SDK, 883 Panel mobile control, 887, 893
OpenWrite method, of WebClient class, 704 Panel Web control, 603, 609–612, 610, 612
operating system PaperSize property, of PageSettings object, 388
item sizing determined by, 308–310 PaperSizes property, of PrinterSettings
for Visual Studio, 7 object, 389
optimistic concurrency, 80, 97–103 PaperSource property, of PageSettings
DataAdapter handling of, 150 object, 388
and row versions, 138 PaperSources property, of PrinterSettings
turning off, 99 object, 389
Option Explicit, 15, 16 Parameter objects, for stored procedures, 68
Option Strict, 15, 16 Parameters property, of Command object, 62
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
ParentNode property, of XmlNode object—printing 965
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
966 PrintListView control—projects
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
properties—Properties dialog box 967
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
968 Properties dialog box for computer—Registers window for debugging
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
registration of Crystal Reports—rows in DataSet 969
registration of Crystal Reports, 777 response file, for compiler options, 454
RegularExpressionValidator mobile control, 887 Resume method, of thread, 407
RegularExpressionValidator Web control, 603, ResumeBinding method, of BindingManager-
625, 628 Base class, 174
disabling during testing, 672 RESX files, 786
RejectChanges method RETR command (POP3), 734, 735
of DataRow object, 109 return value of method, 473
and row versions, 138 reversing default sort order, 119
Relation object, 85 Revise ThreadDemo project, 414–417
relationships, 111–115 right-click menu, creating, 320
in database, for web applications, 247, 248 rights of users
in DataSet restricting, 70
code to set, 102–103 and update problems, 152
creating, 84–87 root element in XML, 788
DataRelation objects, 65, 106 row versions in DataSet
ExploreAllRelations() subroutine, 114–115 current, 138
ExploreRelations() subroutine, 112–114 default, 139–140
and XML, 793–794 original, 138
nested, in XML file, 794–795 proposed, 139–140
relative addresses, and mobile applications, 902 viewing, 146–149
Release version of application, 439–441 RowChanged event, of DataTable object, 176
compiling, 691 RowChanging event, of DataTable object, 175
Remove method RowDeleted event, of DataTable object, 176
of DataRow object, 116 RowDeleting event, of DataTable object, 176
of Items collection, 347 RowError property, of DataGrid control, 97
of SubItems collection, 364 RowFilter property, of DataView object, 122
RemoveAt method Rows collection
of BindingManagerBase class, 174 of DataTable object, 109–111
of SubItems collection, 364 Find method of, 124
RemoveItem method, 347 rows in database. See also DataRow objects
Repeater Web control, 603, 744, 774–775 editing and deleting, 97–98
Replication, for SQL Server 2000, 930 finding by ID, 124–125
RequiredFieldValidator mobile control, locking in pessimistic concurrency, 100
887, 896 updating those with identity columns,
RequiredFieldValidator Web control, 603, 625 152–160
Reset Button HTML control, 605 using transactions, 166–168
Reset method, of IEnumerator object, 354, 514 rows in DataSet
resizing forms. See sizing forms adding, 116–117
Resolve() method, of IPAddress class, 703 deleting, 116
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
970 rows in DataTable object—serializable object
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
Serialization class—soft keys, on mobile devices 971
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
972 software—SQLXML Web service
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
SSL (Secure Sockets Layer)—System.Net class 973
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
974 System.Random class—TextChanged event, of TextBox control
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
TextView mobile control—UDDI (Universal Description, Discovery and Integration) 975
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
976 UdpClient class—VB component
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
VerticalScrollBarArrowHeight property, of SystemInformation object—Web Forms controls 977
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
978 Web Server Certificate Wizard—Windows services
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
Windows, user authentication—XML Web service 979
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.
980 XML wrapper—zero-length string, vs. null value
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved.