Programming Visual Basic

3y ago
50 Views
1 Downloads
2.46 MB
398 Pages
Last View : 5d ago
Last Download : 3m ago
Upload by : Bennett Almond
Transcription

Programming Visual Basic .NETDave GrundgeigerPublisher: O'ReillyFirst Edition January 2002ISBN: 0-596-00093-6, 464 pagesPublished just in time for the first release of Visual Basic Studio .NET, Programming Visual Basic .NETis a programmer's complete guide to Visual Basic .NET. Starting with a sample application and a highlevel map, the book jumps right into showing how the parts of .NET fit with Visual Basic .NET. Topicsinclude the common language runtime Windows Forms, ASP.NET, Web Forms, Web Services, andADO.NET.

Preface. 9Organization of This Book. 9Conventions Used in This Book. 9How to Contact Us . 10Acknowledgments . 11Chapter 1. Introduction . 131.1 What Is the Microsoft .NET Framework?. 131.2 What Is Visual Basic .NET?. 141.3 An Example Visual Basic .NET Program . 14Chapter 2. The Visual Basic .NET Language . 232.1 Source Files . 232.2 Identifiers . 232.3 Keywords . 242.4 Literals . 272.5 Types. 312.6 Namespaces . 402.7 Symbolic Constants . 422.8 Variables . 432.9 Scope. 442.10 Access Modifiers . 442.11 Assignment. 452.12 Operators and Expressions . 462.13 Statements . 522.14 Classes . 602.15 Interfaces. 852.16 Structures . 882.17 Enumerations . 912.18 Exceptions. 932.19 Delegates . 982.20 Events. 1012.21 Standard Modules . 1042.22 Attributes . 1042.23 Conditional Compilation . 1082.24 Summary. 109Chapter 3. The .NET Framework. 1113.1 Common Language Infrastructure (CLI) and Common LanguageRuntime (CLR) . 1113.2 Common Type System (CTS) . 1113.3 Portions of the CLI . 1123.4 Modules and Assemblies. 1133.5 Application Domains. 1163.6 Common Language Specification (CLS) . 1163.7 Intermediate Language (IL) and Just-In-Time (JIT) Compilation 1173.8 Metadata . 1173.9 Memory Management and Garbage Collection . 1183.10 A Brief Tour of the .NET Framework Namespaces. 1222

Programming Visual Basic .NET3.11 Configuration. 1253.12 Summary . 131Chapter 4. Windows Forms I: Developing Desktop Applications. 1334.1 Creating a Form. 1334.2 Handling Form Events . 1434.3 Relationships Between Forms . 1454.4 MDI Applications. 1474.5 Component Attributes . 1554.6 2-D Graphics Programming with GDI . 1604.7 Printing. 1744.8 Summary. 186Chapter 5. Windows Forms II: Controls, Common Dialog Boxes, and Menus . 1875.1 Common Controls and Components. 1875.2 Control Events. 2045.3 Form and Control Layout . 2045.4 Common Dialog Boxes. 2105.5 Menus . 2155.6 Creating a Control . 2275.7 Summary. 236Chapter 6. ASP.NET and Web Forms: Developing Browser-Based Applications 2376.1 Creating a Web Form . 2386.2 Handling Page Events. 2516.3 More About Server Controls . 2536.4 Adding Validation . 2686.5 Using Directives to Modify Web Page Compilation . 2836.6 ASP.NET Objects: Interacting with the Framework . 2916.7 Discovering Browser Capabilities. 2966.8 Maintaining State . 2986.9 Application-Level Code and global.asax . 3046.10 Web-Application Security . 3076.11 Designing Custom Controls . 3206.12 Summary . 328Chapter 7. Web Services. 3297.1 Creating a Web Service . 3297.2 Testing a Web Service with a Browser . 3337.3 Web-Service Descriptions. 3357.4 Consuming a Web Service. 3357.5 Web-Service Discovery. 3407.6 Limitations of Web Services . 3407.7 Summary. 341Chapter 8. ADO.NET: Developing Database Applications . 3438.1 A Brief History of Universal Data Access . 3438.2 Managed Providers . 3438.3 Connecting to a SQL Server Database . 344SQL Server Authentication. 3478.4 Connecting to an OLE DB Data Source . 3488.5 Reading Data into a DataSet. 3493

8.6 Relations Between DataTables in a DataSet . 3608.7 The DataSet's XML Capabilities . 3628.8 Binding a DataSet to a Windows Forms DataGrid. 3648.9 Binding a DataSet to a Web Forms DataGrid. 3678.10 Typed DataSets . 3688.11 Reading Data Using a DataReader. 3708.12 Executing Stored ProceduresThrough a SqlCommand Object . 3718.13 Summary. 374Appendix A. Custom Attributes Defined in the System Namespace . 375Appendix B. Exceptions Defined in the System Namespace. 381Appendix D. Resources for Developers . 391D.1 .NET Information. 391D.2 Discussion Lists. 392Netiquette . 392Appendix E. Math Functions. 395Colophon. 3984

Programming Visual Basic .NETProgramming Visual Basic .NETPrefaceOrganization of This BookConventions Used in This BookHow to Contact UsAcknowledgments1. Introduction1.1 What Is the Microsoft .NET Framework?1.2 What Is Visual Basic .NET?1.3 An Example Visual Basic .NET Program2. The Visual Basic .NET Language2.1 Source Files2.2 Identifiers2.3 Keywords2.4 Literals2.5 Types2.6 Namespaces2.7 Symbolic Constants2.8 Variables2.9 Scope2.10 Access Modifiers2.11 Assignment2.12 Operators and Expressions2.13 Statements2.14 Classes2.15 Interfaces2.16 Structures2.17 Enumerations2.18 Exceptions2.19 Delegates2.20 Events2.21 Standard Modules2.22 Attributes2.23 Conditional Compilation2.24 Summary3. The .NET Framework3.1 Common Language Infrastructure (CLI) and Common Language Runtime (CLR)3.2 Common Type System (CTS)3.3 Portions of the CLI3.4 Modules and Assemblies3.5 Application Domains3.6 Common Language Specification (CLS)3.7 Intermediate Language (IL) and Just-In-Time (JIT) Compilation3.8 Metadata3.9 Memory Management and Garbage Collection3.10 A Brief Tour of the .NET Framework Namespaces3.11 Configuration3.12 Summary4. Windows Forms I: Developing Desktop Applications4.1 Creating a Form4.2 Handling Form Events4.3 Relationships Between Forms5

4.44.54.64.74.8MDI ApplicationsComponent Attributes2-D Graphics Programming with GDI PrintingSummary5. Windows Forms II: Controls, Common Dialog Boxes, and Menus5.1 Common Controls and Components5.2 Control Events5.3 Form and Control Layout5.4 Common Dialog Boxes5.5 Menus5.6 Creating a Control5.7 Summary6. ASP.NET and Web Forms: Developing Browser-Based Applications6.1 Creating a Web Form6.2 Handling Page Events6.3 More About Server Controls6.4 Adding Validation6.5 Using Directives to Modify Web Page Compilation6.6 ASP.NET Objects: Interacting with the Framework6.7 Discovering Browser Capabilities6.8 Maintaining State6.9 Application-Level Code and global.asax6.10 Web-Application Security6.11 Designing Custom Controls6.12 Summary7. Web Services7.1 Creating a Web Service7.2 Testing a Web Service with a Browser7.3 Web-Service Descriptions7.4 Consuming a Web Service7.5 Web-Service Discovery7.6 Limitations of Web Services7.7 Summary8. ADO.NET: Developing Database Applications8.1 A Brief History of Universal Data Access8.2 Managed Providers8.3 Connecting to a SQL Server Database8.4 Connecting to an OLE DB Data Source8.5 Reading Data into a DataSet8.6 Relations Between DataTables in a DataSet8.7 The DataSet's XML Capabilities8.8 Binding a DataSet to a Windows Forms DataGrid8.9 Binding a DataSet to a Web Forms DataGrid8.10 Typed DataSets8.11 Reading Data Using a DataReader8.12 Executing Stored ProceduresThrough a SqlCommand Object8.13 SummaryA. Custom Attributes Defined in the System NamespaceAttributeUsageCLSCompliantContextStatic6

Programming Visual Basic B. Exceptions Defined in the System NamespaceC. CulturesD. Resources for DevelopersD.1 .NET InformationD.2 Discussion ListsE. Math FunctionsColophon7

8

Programming Visual Basic .NETPrefaceThe purpose of this book is to provide experienced software developers with the means to quicklybecome productive in Microsoft's Visual Basic .NET development environment. The only assumption Imake about you as a programmer is that you're comfortable with the concepts and processes ofsoftware development. This book will not teach you how to program. However, if you're currently aworking Visual Basic, C , or Java developer, this book will help you transfer your existing skills to thisnew environment.Organization of This BookThis book contains eight chapters and four appendixes.Chapter 1 starts out with three short hello, world examples that show how to enter and compile aconsole app, a GUI app, and a browser app. This gives the reader immediate gratification. Thechapter also provides an overview of the .NET Framework and Visual Basic .NET.Chapter 2 examines the syntax and use of the Visual Basic .NET language. This will not teachsomeone how to program, but it will teach a programmer how to program in Visual Basic .NET.Chapter 3 explains the various components of the .NET Framework and explains why the .NETFramework is a Good Thing.Chapter 4 explains how to use the Windows Forms class library for building GUI applications.Chapter 5 picks up where Chapter 4 left off by discussing individual controls, showing how to usethe common dialog boxes available in the .NET Framework, and examining menu creation and use.Chapter 6 explains how to use the Web Forms class library for building browser-based applications.Chapter 7 talks about building components that provide services over the Internet and how toconsume those services.Chapter 8 explains the distributed, stateless, disconnected data model encapsulated by ADO.NET.Appendix A provides a list of the types known as attributes. The concept of attributes is discussed inChapter 2.Appendix B provides a list of system-generated exceptions. The concept of exceptions is discussedin Chapter 2.Appendix C provides a list of culture names and IDs for globalization.Appendix D provides a list of online resources where developers can get help and further informationon Visual Basic .NET.Appendix E lists the standard math functions that are available to the Visual Basic .NET programmervia the .NET Framework's Math class.Conventions Used in This BookThroughout this book, we've used the following typographic conventions:9

Constant widthConstant width in body text indicates a language construct, such as the name of a storedprocedure, a SQL statement, a Visual Basic .NET statement, an enumeration, an intrinsic oruser-defined constant, a structure (i.e., a user-defined type), or an expression (likedblElapTime Timer - dblStartTime). Code fragments and code examples appearexclusively in constant-width text. In syntax statements and prototypes, text set in constantwidth indicates such language elements as the function or procedure name and any invariableelements required by the syntax.Constant width italicConstant width italic in body text indicates parameter names. In syntax statements orprototypes, constant width italic indicates replaceable parameters. In addition, constant widthitalic is used in body text to denote variables.ItalicItalicized words in the text indicate intrinsic or user-defined function and procedure names.Many system elements, such as paths and filenames, are also italicized. URLs and emailaddresses are italicized. Finally, italics are used for new terms where they are defined.This icon indicates a tip, suggestion, or general note.This icon indicates a warning or caution.How to Contact UsPlease address comments and questions concerning this book to the publisher:O'Reilly & Associates, Inc.1005 Gravenstein Highway NorthSebastopol, CA 95472(800) 998-9938 (in the United States or Canada)(707) 829-0515 (international/local)(707) 829-0104 (fax)There is a web page for this book, where we list errata, examples, or any additional information. Youcan access this page at:http://www.oreilly.com/catalog/progvbdotnetTo comment or ask technical questions about this book, send email to:bookquestions@oreilly.comFor more information about our books, conferences, Resource Centers, and the O'Reilly N

Programming Visual Basic .NET Dave Grundgeiger Publisher: O'Reilly First Edition January 2002 ISBN: 0-596-00093-6, 464 pages Published just in time for the first release of Visual Basic Studio .NET, Programming Visual Basic .NET is a programmer's complete guide to Visual Basic .NET.

Related Documents:

Visual Basic is a third-generation event-driven programming language first released by Microsoft in 1991. The versions of visual basic in shown below: The final version of the classic Visual Basic was Visual Basic 6. Visual Basic 6 is a user-friendly programming language designed for beginners. In 2002, Microsoft released Visual Basic.NET (VB .

What Visual Basic is not H Visual Basic is not, a powerful programming language that enables you to do anything you want. H Visual Basic is not, elegant or fast. H Visual Basic is not, a replacement for C. H Visual Basic is not, anything like any other programming language you have ever used.

Visual Basic - Chapter 2 Mohammad Shokoohi * Adopted from An Introduction to Programming Using Visual Basic 2010, Schneider. 2 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual Basic Events. 3 2.1 An Introduction to

Visual Basic 6.0 versus Other Versions of Visual Basic The original Visual Basic for DOS and Visual Basic F or Windows were introduced in 1991. Visual Basic 3.0 (a vast improvement over previous versions) was released in 1993. Visual Basic 4.0 released in late 1995 (added 32 bit application support).

BASIC, such as Microsoft QBASIC, QUICKBASIC, GWBASIC ,IBM BASICA and so on. VISUAL BASIC is a VISUAL and events driven Programming Language.These are the main divergence from the old BASIC. In BASIC, programming is done in a text-only environment and the prgram is executed sequentially. In VISUAL BASIC, programming is done in a graphical .

Visual Basic 8.0 o Visual Basic 2005, nato nel 2005, è stato implementato sul .NET Framework 2.0. Non si usa più la keyword .NET nel nome, in quanto da questo momento sarà sottointeso che Visual Basic è basato sul .NET Framework. Visual Basic 9.0 o Visual Basic 2008, nato nel 2008, è stato implementato sul .NET Framework 3.5.

Bab 1 Pengenalan Visual Basic 6 Visual Basic 6 merupakan salah satu tool untuk pengembangan aplikasi yang banyak diminati oleh orang. Di sini Visual Basic 6 menawarkan kemudahan dalam pembuatan aplikasi dan dapat menggunakan komponen-komponen yang telah disediakan. Untuk memulai Visual Basic 6 anda perlu menginstall Visual Basic 6.0.

A-3 Short Beam Shear (ASTM D 2344) A-4 Two-Rail Shear (ASTM D 4255) A-5 Three-Rail Shear (ASTM D 4255) A-6 Shear Strength by Punch Tool (ASTM D 732) A-7 Sandwich Panel Flatwise Shear (ASTM C 273) A-8 Special Sandwich Panel Shear Fixture (ASTM C 273) SEZIONE B: PROVE DI COMPRESSIONE B-1 Wyoming Combined Loading Compression (ASTM D 6641) B-2 Modified ASTM D 695 (Boeing BSS 7260) B-3 IITRI .