Professional Visual Basic 2012 and .NET 4.5 Programming

Overview

Explore Visual Basic 2012 and .NET 4.5 with this fully updated resource

After a quick review of the of introductory topics of Visual Basic 2012 and .NET 4.5, this book moves quickly into advanced topics such as data access with ADO.NET, security, ASP.NET web programming with Visual Basic, Windows workflow, and threading. You'll explore the essential Visual Basic 2012 functions you need, including .NET features such as LINQ, WCF, and more. Plus,...

See more details below
Paperback
$41.06
BN.com price
(Save 31%)$59.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (18) from $24.95   
  • New (13) from $24.99   
  • Used (5) from $24.95   
Professional Visual Basic 2012 and .NET 4.5 Programming

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$34.49
BN.com price
(Save 42%)$59.99 List Price

Overview

Explore Visual Basic 2012 and .NET 4.5 with this fully updated resource

After a quick review of the of introductory topics of Visual Basic 2012 and .NET 4.5, this book moves quickly into advanced topics such as data access with ADO.NET, security, ASP.NET web programming with Visual Basic, Windows workflow, and threading. You'll explore the essential Visual Basic 2012 functions you need, including .NET features such as LINQ, WCF, and more. Plus, you'll examine exception handling and debugging, Visual Studio features, and deployment.

  • Puts the new Async keyword and Iterators to work
  • Explores new options and interfaces presented by Windows 8 development and WinRT
  • Continues strong coverage of core language elements and tools and creating componentized applications

This updated version of Professional Visual Basic 2012 and .NET 4.5 retains its expert author team, including one of the best-known and respected Microsoft Visual Basic MVPs, Bill Sheldon, and Microsoft Regional Director “Software Legend” Billy Hollis.

Read More Show Less

Product Details

  • ISBN-13: 9781118314456
  • Publisher: Wiley
  • Publication date: 1/4/2013
  • Edition number: 1
  • Pages: 912
  • Sales rank: 365,682
  • Product dimensions: 7.30 (w) x 9.20 (h) x 1.70 (d)

Meet the Author

Bill Sheldon, Visual Basic MVP for 8 years, is the Vice President of Information Technology for Rubio's Restaurants. He can be found at @NerdNotes.

Billy Hollis, MVP, is a developer and UX designer at Next Version Systems. He is also a well-known and prolific speaker and trainer.

Rob Windsor, MVP, is Lead SharePoint Consultant with Portal Solutions—a Microsoft Gold Partner.

David McCarter, MVP, is a principal software engineer/architect and editor-in-chief of dotNetTips.com.

Gaston C. Hillar, MVP, is tech leader and architect at Bootsoft Inc. He contributes to Dr. Dobbs and blogs for Intel Software Network.

Todd Herman is a senior software engineer at Apx Labs focused on developing a library to support the XMPP standard.

Read More Show Less

Table of Contents

INTRODUCTION xxxi

PART I: LANGUAGE CONSTRUCTS AND ENVIRONMENT

CHAPTER 1: VISUAL STUDIO 2012 3

Visual Studio 2012 4

Visual Basic Keywords and Syntax 5

Console Applications 10

Creating a Project from a Project Template 11

The Solution Explorer 14

Project Properties 15

Assembly Information Screen 16

Compiler Settings 18

Debug Properties 21

References 23

Resources 24

Settings 26

Other Project Property Tabs 27

Project ProVB_VS2012 28

Enhancing a Sample Application 31

Customizing the Code 33

Building Applications 44

Running an Application in the Debugger 45

Reusing Your First Windows Form 52

Useful Features of Visual Studio 2012 52

The Task List 52

Server Explorer 53

Class Diagrams 54

Summary 56

CHAPTER 2: THE COMMON LANGUAGE RUNTIME 57

Framework Profi les and Platforms 58

Client and Full Framework Profi les 59

Framework for Metro 59

Silverlight, Windows Phone, and Others 60

.NET 4.5 Portable Class Library 60

Elements of a .NET Application 61

Types 61

Modules 62

Assemblies 63

Cross-Language Integration 65

The Common Type System 65

Metadata 66

The Reflection API 69

IL Disassembler 70

Memory Management 71

Traditional Garbage Collection 72

Faster Memory Allocation for Objects 77

Garbage Collector Optimizations 79

Namespaces 81

What Is a Namespace? 81

Namespaces and References 84

Common Namespaces 86

Importing and Aliasing Namespaces 86

Aliasing Namespaces 89

Referencing Namespaces in ASP.NET 89

Creating Your Own Namespaces 90

The My Keyword 93

My.Application 94

My.Computer 97

My.Resources 99

My.User 99

Extending the My Namespace 100

Summary 102

CHAPTER 3: OBJECTS AND VISUAL BASIC 103

Object-Oriented Terminology 105

Objects, Classes, and Instances 105

Composition of an Object 105

System.Object 108

Working With Visual Basic Types 109

Value and Reference Types 109

Primitive Types 112

Commands: Conditional 114

If Then 114

Comparison Operators 115

Select Case 117

Value Types (Structures) 117

Boolean 118

Integer Types 119

Unsigned Types 120

Decimal Types 121

Char and Byte 123

DateTime 124

Reference Types (Classes) 125

The Object Class 125

The String Class 126

The DBNull Class and IsDBNull Function 130

Parameter Passing 131

ParamArray 132

Variable Scope 133

Working with Objects 134

Objects Declaration and Instantiation 134

Object References 135

Early Binding versus Late Binding 136

Data Type Conversions 137

Performing Explicit Conversions 138

Creating Classes 143

Basic Classes 143

Handling Events 152

Handling Multiple Events 153

The WithEvents Keyword 154

Raising Events 154

Declaring and Raising Custom Events 155

Receiving Events with WithEvents 156

Receiving Events with AddHandler 158

Constructor Methods 160

Object-Oriented Concepts 161

Overloading Methods 161

Overloading Constructor Methods 164

Shared Methods, Variables, and Events 165

Operator Overloading 169

Delegates 172

Summary 176

CHAPTER 4: CUSTOM OBJECTS 179

Inheritance 180

When to Use Inheritance 181

Implementing Inheritance 183

Interacting with the Base Class, Yourself, and Your Class 202

Constructors 206

Object Scope 209

Events and Inheritance 211

Shared Methods 213

Creating an Abstract Base Class 213

Multiple Interfaces 216

Object Interfaces 216

Abstract Interfaces 217

Abstraction 225

Encapsulation 228

Polymorphism 228

Method Signatures 228

Implementing Polymorphism 229

Summary 235

CHAPTER 5: ADVANCED LANGUAGE CONSTRUCTS 237

Preparing the Sample Application 238

Lambda Expressions 240

Creating a Lambda Expression Subroutine 241

Creating a Lambda Expression Function 242

Using Lambda Expressions 243

Handling Events with Lambdas 244

LINQ with Lambdas 245

Async and Await 247

The Core Concept 248

Using Async and Await 252

Iterators 256

The Core Concept 256

Using Iterators 259

Summary 261

CHAPTER 6: EXCEPTION HANDLING AND DEBUGGING 263

System.Exception 264

Handling Exceptions 265

Try, Catch, and Finally 265

The Throw Keyword 267

The Exit Try Statement 268

Using Exception Properties 269

Logging Errors 273

The Event Log 273

Using the Trace and Debug Objects 275

Summary 278

PART II: BUSINESS OBJECTS AND DATA ACCESS

CHAPTER 7: ARRAYS, COLLECTIONS, AND GENERICS 281

Arrays 282

Multidimensional Arrays 284

The UBound Function 284

The ReDim Statement 285

The Preserve Keyword 286

Collections 286

Iterative Statements 288

Boxing 291

Generics 292

Using Generics 293

Nullable Types 294

Generic Types 295

Generic Methods 298

Creating Generics 300

Generic Types 300

Generic Methods 307

Constraints 308

Generics and Late Binding 311

Covariance and Contravariance 312

Summary 314

CHAPTER 8: USING XML WITH VISUAL BASIC 315

An Introduction to XML 316

XML Serialization 318

Serializing 318

Deserializing 320

Source Code Style Attributes 322

System.Xml Document Support 324

XML Stream-Style Parsers 325

Document Object Model (DOM) 337

LINQ to XML 342

LINQ Helper XML Objects 343

XML Literals 347

Querying XML Documents 349

Reading and Writing XML Documents 351

XSL Transformations 354

XSLT Transforming between XML Standards 357

Other Classes and Interfaces in System.Xml.Xsl 360

XML in ASP.NET 361

The XmlDataSource Server Control 361

The XmlDataSource Control’s Namespace Problem 365

The Xml Server Control 366

Summary 368

CHAPTER 9: ADO.NET AND LINQ 369

ADO.NET Architecture 371

Basic ADO.NET Features 372

Common ADO.NET Tasks 372

Basic ADO.NET Namespaces and Classes 377

ADO.NET Components 378

.NET Data Providers 380

Connection Object 380

Command Object 381

Using Stored Procedures with Command Objects 382

DataReader Object 385

Executing Commands Asynchronously 387

DataAdapter Objects 389

SQL Server .NET Data Provider 394

OLE DB .NET Data Provider 394

The DataSet Component 395

DataTableCollection 395

DataRelationCollection 395

ExtendedProperties 396

Creating and Using DataSet Objects 397

ADO.NET DataTable Objects 398

Advanced ADO.NET Features of the DataSet and DataTable Objects 399

Working with the Common Provider Model 401

Connection Pooling in ADO.NET 403

Transactions and System.Transactions 403

Creating Transactions 403

Creating Resource Managers 405

Summary 406

CHAPTER 10: DATA ACCESS WITH THE ENTITY FRAMEWORK 407

Object-Relational Mapping 408

Entity Framework Architecture 408

Conceptual Model 410

Storage Model 416

Mapping Model 417

LINQ to Entities 417

The ObjectContext 418

Mapping Objects to Entities 419

Simple Mapping 419

Using a Single Table for Multiple Objects 422

Updating the Model 425

Summary 426

CHAPTER 11: SERVICES (XML/WCF) 429

Web Services 430

How This All Fits Together 431

What Makes a WCF Service 431

The Larger Move to SOA 432

Capabilities of WCF 433

Contracts and Metadata 434

Working with the WS-* Protocols 434

Building a WCF Service 436

Creating the Interface 437

Utilizing the Interface 438

Hosting the WCF Service in a Console Application 439

Reviewing the WSDL Document 443

Building a WCF Consumer 445

Adding a Service Reference 445

Reviewing the Reference 447

Configuration File Changes 449

Writing the Consumption Code 451

Working with Data Contracts 453

Namespaces 455

Building the Host 456

Building the Consumer 456

Looking at WSDL and the Schema for

HelloCustomerService 459

Summary 461

PART III: SPECIALIZED TOPICS AND LIBRARIES

CHAPTER 12: XAML ESSENTIALS 465

Features Shared by All XAML Platforms 466

The XAML Markup Language 466

A Sample Page of XAML 467

Code-Behind and Naming of Elements 468

Getting Our Terminology Straight 469

The UIElement and FrameworkElement Classes 469

Commonly Used Elements 469

Property Setting: Attribute Syntax vs. Element Syntax 470

Referencing Additional Namespaces in XAML 471

The Layout System 472

Measurement Units 472

Panels 472

Sizing and Layout of Elements 479

Controls and Content 484

Content Controls 484

Implications of the Content Model 485

Brushes 486

Resources in XAML 488

The Resources Property 488

More About Resource Dictionaries 489

Scope of a Resource 489

Data Binding 489

Data Binding: Fundamental Concepts 490

The Binding Class and Binding Expressions 491

DataContext 492

Data Bindings between XAML Elements 492

Other Ways to Specify a Data Source 493

Property Change Notifi cation 494

Data Conversion during Binding 494

Dealing with Binding Failures 497

Complex Binding Paths 498

Working with Data Bindings in Code 498

Data Templates and ItemControls 499

Setting the Stage with Some Sample Data 500

ItemControls 501

The XAML ListBox 501

Data Templates 503

Data Binding in Data Templates 506

Switching between Data Templates 507

Changing Layout of ListBox Items with ItemsPanel 510

Additional ItemControls 510

Styles 510

What is a Style? 510

Determining the Scope of a Style 511

Implicit Styles 512

BasedOn Styles 512

ItemContainerStyle 512

Control Templates 513

“Lookless” Controls 513

Reskinning a CheckBox 514

Creating Control Templates 515

Summary 515

CHAPTER 13: CREATING XAML APPLICATIONS FOR WINDOWS 8 517

How XAML Diff ers in Windows 8 518

Missing Elements 518

Old Elements Replaced by Functional Equivalents in Windows 8 519

Syntax Diff erences 519

Using Page as the Root Visual Element 520

Windows 8 UI Conventions 520

UI/UX Guidelines 522

Interaction between Your App and the Windows 8 OS 522

Chromeless Apps 522

Snapped Views 522

Typeface and Font Guidelines 523

Sizing and Layout of Visual Elements in an App 523

New Visual Elements in Windows 8 524

AppBar 524

ListView, GridView, and FlipView Controls 527

Pickers 542

ProgressRing 543

ToggleSwitch 544

Other New Elements 544

Old Elements with New Usage 545

Changes to the Visual Designer in Visual Studio 2012 547

Better Resource Selector 547

Common vs. Advanced Property Categories 548

Transform Properties 549

Animation 549

Application Templates in Visual Studio 2012 551

Split App 552

Grid App 552

Layout Aware Pages 555

Items in the Common Folder 555

StandardStyles.xaml 555

Online Documentation for Grid App and Split App Templates 556

Implementing a Live Tile 557

Implementing Contracts 558

Summary 560

CHAPTER 14: APPLICATIONS WITH ASP.NET, MVC, JAVASCRIPT, AND HTML 561

Visual Studio Support for ASP.NET 562

Web Site and Web Application Projects 562

Web Server Options 562

Server-Side Development 563

Web Forms 563

Web Pages and Razor 586

ASP.NET MVC 602

Client-Side Web Development 624

Web Development with HTML and JavaScript 624

Building Windows 8 Style Apps with HTML and JavaScript 638

Summary 644

CHAPTER 15: LOCALIZATION 645

Cultures and Regions 646

Understanding Culture Types 647

Looking at Your Thread 647

Declaring Culture Globally in ASP.NET 649

Adopting Culture Settings in ASP.NET 650

Translating Values and Behaviors 652

Understanding Diff erences in Dates 652

Differences in Numbers and Currencies 654

Understanding Diff erences in Sorting 656

ASP.NET Resource Files 658

Making Use of Local Resources 658

Localization for Windows Store Apps 663

Summary 665

CHAPTER 16: APPLICATION SERVICES 667

Using IIS for Application Services 668

Windows Services 668

Characteristics of a Windows Service 669

Interacting with Windows Services 669

Creating a Windows Service 671

The .NET Framework Classes for Windows Services 671

Other Types of Windows Services 674

Creating a Windows Service in Visual Basic 675

Creating a File Watcher Service 676

Creating a Solution for the Windows Service 677

Adding .NET Components to the Service 677

Installing the Service 680

Starting the Service 681

Uninstalling the Service 682

Communicating with the Service 683

The ServiceController Class 683

Integrating a ServiceController into the Example 685

More about ServiceController 686

Custom Commands 686

Passing Strings to a Service 688

Debugging the Service 689

Summary 690

CHAPTER 17: ASSEMBLIES AND REFLECTION 693

Assemblies 694

The Manifest 694

Assembly Identity 696

Referenced Assemblies 700

Assemblies and Deployment 701

Application-Private Assemblies 701

Shared Assemblies 701

Versioning Issues 703

Application Isolation 703

Side-By-Side Execution 704

Self-Describing Components 704

Version Policies 704

Configuration Files 706

Basics of Refl ection 709

The Assembly Class 710

Getting Currently Loaded Assemblies 711

The Type Class 711

Dynamic Loading of Assemblies 713

The LoadFrom Method of the Assembly Class 713

Dynamic Loading Example 714

Putting Assemblies to Work 716

Summary 716

CHAPTER 18: SECURITY IN THE .NET FRAMEWORK 719

Security Concepts and Defi nitions 720

Windows Store Projects 722

The System.Security.Permissions Namespace 723

Code Access Permissions 727

Identity Permissions 728

Role-Based Permissions 728

Managing Code Access Permission Sets 731

User Access Control 734

Defining Your Application UAC Settings 735

Security Tools 737

Exceptions Using the SecurityException Class 738

Encryption Basics 739

Hash Algorithms 741

Cryptographic Hash Algorithms 741

Symmetric Key Encryption 744

PKCS 747

Secure Sockets Layer 752

Summary 754

CHAPTER 19: PARALLEL PROGRAMMING USING TASKS AND THREADS 757

Launching Parallel Tasks 758

System.Threading.Tasks.Parallel Class 758

Parallel.Invoke 759

Transforming Sequential Code to Parallel Code 764

Detecting Hotspots 765

Measuring Speedups Achieved by Parallel Execution 767

Understanding Parallel 769

Parallelizing Loops 770

Parallel.For 770

Parallel.ForEach 775

Exiting from Parallel Loops 781

Specifying the Desired Degree of Parallelism 786

ParallelOptions 786

Understanding Hardware Threads and Logical Cores 788

Creating and Managing Tasks 788

System.Threading.Tasks.Task 790

Understanding a Task’s Life Cycle 791

Using Tasks to Parallelize Code 793

Returning Values from Tasks 802

Preparing the Code for Parallelism 805

Understanding Concurrent Collection Features 807

Transforming LINQ into PLINQ 810

Summary 813

CHAPTER 20: DEPLOYING XAML APPLICATIONS VIA THE WINDOWS 8 WINDOWS STORE 815

A New Deployment Option for Windows 8 Apps 815

Deployment of WinRT Apps 816

Developer License 817

Working with the Windows Store 817

Getting an Account at the Windows Store 817

Microsoft Account is Required 818

Windows Store Account Types 818

Steps to Obtain an Account 818

Requirements for Apps in the Windows Store 821

Specific Requirements 822

General Requirements 822

Working with the Windows Store in Visual Studio 2012 823

Options on the Store Menu 824

Creating an App Package 825

Checking to See if an App Meets Requirements 826

Deploying the App to the Windows Store 827

Side-loading for LOB Apps in an Organization 828

Packaging and Validation 829

Preparing Client Machines for Side-loading 829

The Side-loading Operation 830

Summary 831

INDEX 833

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)