ebook img

Visual Studio 2010 All-in-One For Dummies PDF

886 Pages·2010·16.02 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Visual Studio 2010 All-in-One For Dummies

spine=1.82” It’s new and better than ever! Software Development & ProgrMamicmroisnogf/t Extending the Family Going the Extra Mile Data Access Building Applications Coding Getting Started OverviewVisual Studio 2010 Making Everything Easier!™ Learn to use Visual Studio 2010 with this book Developers, listen up! Visual Studio 2010 offers many interface • T h e Olapngeuna gthese o bf .oNoEkT and find: Vis Visual Studio® 2010 changes and a dizzying array of editors, controls, designers, • Advice on installing Visual Studio u and other tools. Whether you’re starting from scratch with a Visual Studio or need to boost your knowledge of coding, • Basic info about object-oriented building apps, or accessing data, you’ll find what you need programming Al S A L L - I N - O N E to be productive. • Tips on handling exceptions and L debugging Lt - • Get what you need — newbies can learn Visual Studio basics Iu N while more experienced developers can focus on what’s new in • How to lay out a Web site -d the 2010 version O • Why you need ADO.NET Ni • Code mode — create source code with the code editor, explore Eo • How to build applications for class anatomy in .NET, and debug, analyze, and test your code Facebook ® • Building blocks — explore types of applications you can build; 2 learn to create C++, Windows, and Web applications; and deploy • What the Visual Studio Team 0 them on the cloud System offers 1 • Digging data — look at the new data access code-generation 0 features in Visual Studio • Take control — manage the build process and apply source 7 code control BBOOOOKKSS 1 IN Visit the companion Web site at www.dummies.com/go/ Go to Dummies.com® vs2010, where you’ll find a section featuring source code, for videos, step-by-step examples, resource links, and sample applications for each minibook. how-to articles, or to shop! • Visual Studio 2010 Overview • Getting Started • Coding • Building Applications • Data Access $39.99 US / $47.99 CN / £27.99 UK • Going the Extra Mile Andrew Moore is an experienced software developer with expertise in ISBN 978-0-470-53943-9 • Extending the Family C, C++, and C#. Currently a senior software engineer, he has development experience with air traffic management, discrete-event simulation, and most recently with VoIP and multimedia business communication systems. Andrew Moore Moore Visual Studio 2010 ® ALL-IN-ONE FOR DUMmIES ‰ by Andrew Moore 0011__553399443399--ffffiirrss..iinndddd ii 55//2211//1100 11::4477 PPMM Visual Studio® 2010 All-in-One For Dummies® Published by Wiley Publishing, Inc. 111 River Street Hoboken, NJ 07030-5774 www.wiley.com Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permit- ted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http:// www.wiley.com/go/permissions. Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates in the United States and other countries, and may not be used without written permission. Visual Studio is a registered trademark of Microsoft Corporation in the United States and/or other countries. All other trademarks are the property of their respective owners. Wiley Publishing, Inc. is not associated with any product or vendor mentioned in this book. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITH- OUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZA- TION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit www.wiley.com/techsupport. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2010928464 ISBN: 978-0-470-53943-9 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 0011__553399443399--ffffiirrss..iinndddd iiii 55//2211//1100 11::4477 PPMM Publisher’s Acknowledgments We’re proud of this book; please send us your comments at http://dummies.custhelp.com. For other comments, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. Some of the people who helped bring this book to market include the following: Acquisitions, Editorial, and Media Composition Services Development Project Coordinator: Katherine Crocker Project Editor: Kelly Ewing Layout and Graphics: Carrie A. Cesavice, Acquisitions Editor: Katie Feltman Ashley Chamberlain, Samantha K. Cherolis Technical Editor: Russ Mullen Proofreaders: Rebecca Denoncour, Evelyn Wellborn Editorial Manager: Jodi Jensen Indexer: Becky Hornyak Media Development Project Manager: Laura Moss-Hollister Media Development Assistant Project Manager: Jenny Swisher Editorial Assistant: Amanda Graham Sr. Editorial Assistant: Cherie Case Cartoons: Rich Tennant (www.the5thwave.com) Publishing and Editorial for Technology Dummies Richard Swadley, Vice President and Executive Group Publisher Andy Cummings, Vice President and Publisher Mary Bednarek, Executive Acquisitions Director Mary C. Corder, Editorial Director Publishing for Consumer Dummies Diane Graves Steele, Vice President and Publisher Composition Services Debbie Stailey, Director of Composition Services 0011__553399443399--ffffiirrss..iinndddd vvii 55//2211//1100 11::4477 PPMM Contents at a Glance Introduction ................................................................ 1 Book I: Visual Studio 2010 Overview ............................ 9 Chapter 1: What Is Visual Studio? ..................................................................................11 Chapter 2: Exploring .NET ..............................................................................................19 Chapter 3: Modern Software Development ..................................................................27 Chapter 4: The Languages of .NET.................................................................................49 Chapter 5: The Many Editions of Visual Studio 2010 ..................................................61 Chapter 6: New to Visual Studio 2010 ...........................................................................73 Book II: Getting Started with Visual Studio ................. 79 Chapter 1: Installing Visual Studio Professional ..........................................................81 Chapter 2: Browsing Visual Studio ................................................................................91 Chapter 3: Making Connections with Visual Studio ..................................................105 Chapter 4: Upgrading .NET ...........................................................................................113 Book III: Coding ...................................................... 125 Chapter 1: Programming with Visual Studio 2010 .....................................................127 Chapter 2: Understanding Data Types ........................................................................145 Chapter 3: Get Some Class ............................................................................................179 Chapter 4: Wiring Up Events in the User Interface ....................................................205 Chapter 5: Getting Productive with Visual Studio 2010 ............................................223 Chapter 6: Exploring Web Services .............................................................................251 Chapter 7: Handling Exceptions and Debugging ........................................................275 Chapter 8: Testing Code with Visual Studio ...............................................................301 Book IV: Basics of Building Applications with Visual Studio 2010 .................................................. 317 Chapter 1: Getting Smart about Smart Clients ...........................................................319 Chapter 2: Building Smart Client User Interfaces ......................................................339 Chapter 3: Building Visual C++ Applications ..............................................................365 Chapter 4: Building Web Applications ........................................................................381 Chapter 5: Using AJAX for Rich Web Pages ................................................................407 0022__553399443399--ffttoocc..iinndddd vviiii 55//2211//1100 11::4466 PPMM Chapter 6: Laying Out Your Web Site ..........................................................................419 Chapter 7: Exploring ASP.NET Services ......................................................................447 Chapter 8: Using Threads and Timers ........................................................................465 Chapter 9: Writing Network Applications ...................................................................483 Chapter 10: Parallel Programming ...............................................................................499 Chapter 11: Writing Silverlight Applications ..............................................................525 Chapter 12: Programming for the Cloud .....................................................................541 Book V: Getting Acquainted with Data Access ........... 549 Chapter 1: Accessing Data with Visual Studio ...........................................................551 Chapter 2: Show Me the Data .......................................................................................569 Chapter 3: Working with Strongly Typed DataSets ...................................................605 Chapter 4: Working with XML ......................................................................................641 Chapter 5: Under the Hood with ADO.NET.................................................................659 Chapter 6: Using Visual Studio with SQL Server ........................................................697 Chapter 7: LINQ ..............................................................................................................725 Book VI: Going the Extra Mile ................................... 731 Chapter 1: Building Solutions and Projects ................................................................733 Chapter 2: Deployment Options ..................................................................................751 Chapter 3: Checking Out Source Control ....................................................................777 Chapter 4: Writing Custom Facebook Applications ..................................................795 Book VII: Extending the Family ................................. 817 Chapter 1: Exploring Visual Studio Extensions ..........................................................819 Chapter 2: Being a Team Player with Visual Studio Team System ..........................827 Index ...................................................................... 843 0022__553399443399--ffttoocc..iinndddd vviiiiii 55//2211//1100 11::4466 PPMM Table of Contents Introduction ................................................................. 1 Who Should Read This Book? ........................................................................2 About This Book ..............................................................................................3 Foolish Assumptions .......................................................................................4 Conventions Used in This Book .....................................................................4 Stuff you type .........................................................................................4 Menu commands ....................................................................................4 Display messages ...................................................................................5 How This Book Is Organized ..........................................................................5 Book I: Visual Studio 2010 Overview ...................................................5 Book II: Getting Started with Visual Studio.........................................5 Book III: Coding ......................................................................................5 Book IV: Basics of Building Applications with Visual Studio 2010 .....................................................................6 Book V: Getting Acquainted with Data Access...................................6 Book VI: Going the Extra Mile ...............................................................6 Book VII: Extending the Family ............................................................6 About the Companion Web Site .....................................................................6 Icons Used in This Book .................................................................................7 Book I: Visual Studio 2010 Overview ............................. 9 Chapter 1: What Is Visual Studio?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 From Source Code to Application: How Software Is Written ...................11 The Role of the Integrated Development Environment ............................13 Tools beyond the basic three ............................................................14 Enter Visual Studio ..............................................................................14 Visual Studio as the Hub ...............................................................................16 The Keeper of .NET .......................................................................................17 Chapter 2: Exploring .NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 Following the Evolution of .NET ..................................................................19 Getting Acquainted with the .NET Components ........................................21 .NET freebies ........................................................................................22 No free lunch ........................................................................................23 Peering into the Future of .NET ...................................................................24 0022__553399443399--ffttoocc..iinndddd iixx 55//2211//1100 11::4466 PPMM x Visual Studio 2010 All-in-One For Dummies Chapter 3: Modern Software Development. . . . . . . . . . . . . . . . . . . . . . .27 Examining the Software Development Process .........................................27 Looking at Software Engineering in Action ................................................28 Have process, will repeat ....................................................................29 Practicing what you preach ................................................................32 Building a developer’s toolbox ..........................................................33 Working with your partners in development ...................................35 Components Defeat Monoliths ....................................................................35 Architecture evolution ........................................................................37 Component management in .NET ......................................................39 Managed Code Execution .............................................................................42 Taking Out the Garbage ................................................................................45 Allocating memory...............................................................................47 Releasing memory ...............................................................................48 Chapter 4: The Languages of .NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 More than Just a Pretty Face: A Windows Application .............................49 Looking at the Languages of .NET ...............................................................50 Visual Basic...........................................................................................51 Visual C# ...............................................................................................52 Visual C++ .............................................................................................53 F#............................................................................................................54 Choosing the Right Language for the Job ...................................................55 Becoming a Good Programmer ....................................................................57 Learn the syntax ..................................................................................58 Write your own code ...........................................................................58 Chapter 5: The Many Editions of Visual Studio 2010 . . . . . . . . . . . . . . .61 Making Sense of the Visual Studio Editions ...............................................61 Visual Studio Express Editions ..........................................................62 Visual Studio Professional ..................................................................63 Visual Studio Team System ................................................................64 Choosing the Right Edition ...........................................................................64 Subscribing to the Microsoft Developer Network ...........................65 Weighing your options ........................................................................66 Developing When It’s a Team Effort ............................................................68 Managing projects with Team System ..............................................68 Architecting software ..........................................................................69 Developing software with Team System ...........................................70 Testing with tools ................................................................................71 Collaborating with Visual Studio Team Foundation ........................71 Chapter 6: New to Visual Studio 2010. . . . . . . . . . . . . . . . . . . . . . . . . . . .73 Exploring Additional Programming Paradigms .........................................73 Parallel programming ..........................................................................74 Cloud computing ..................................................................................75 0022__553399443399--ffttoocc..iinndddd xx 55//2211//1100 11::4466 PPMM xi Table of Contents Reaping the Benefi ts for Development Teams ...........................................75 Enhanced user interface .....................................................................76 Better development lifecycle management ......................................76 Better programming productivity .....................................................77 Better Web development tools ..........................................................77 Gaining Databases Support ..........................................................................77 Book II: Getting Started with Visual Studio .................. 79 Chapter 1: Installing Visual Studio Professional . . . . . . . . . . . . . . . . . .81 Installing Versions Side by Side ...................................................................81 Taking a look at all the .NETs .............................................................82 Getting help from Visual Studio 2010 ................................................82 Meeting System Requirements ....................................................................85 Stepping through the Installation ................................................................86 Launching Visual Studio for the First Time ................................................87 Chapter 2: Browsing Visual Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 Making Your Way around Visual Studio .....................................................91 Dealing with Windows Galore ......................................................................92 Docking windows .................................................................................93 Working with tabbed documents ......................................................94 Managing windows ..............................................................................94 Building Solutions with Visual Studio 2010 ................................................95 Using the Solution Explorer to manage solutions and projects .....................................................................97 Working with solution and project menus .......................................99 Using the Properties Window ......................................................................99 Browsing Servers .........................................................................................100 Writing Code with the Code Editor ...........................................................101 Using the Forms Designer ...........................................................................102 Taking a Look at Other Designers .............................................................102 Chapter 3: Making Connections with Visual Studio . . . . . . . . . . . . . .105 Getting Help ..................................................................................................105 Opening and navigating the help documentation .........................106 Searching and fi ltering search results .............................................108 Customizing the start page ...............................................................108 Staying in Touch with the .NET Community ............................................109 Pursuing certifi cation ........................................................................110 Viewing Webcasts ..............................................................................111 0022__553399443399--ffttoocc..iinndddd xxii 55//2211//1100 11::4466 PPMM xii Visual Studio 2010 All-in-One For Dummies Chapter 4: Upgrading .NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 Making the Business Case for Upgrading .................................................113 What happens to Visual Studio code in an upgrade? ....................114 What are alternatives to upgrading? ...............................................115 How do you upgrade from pre-.NET languages? ............................115 Considering Your Conversion Strategies .................................................116 Converting Windows applications and class libraries ..................117 Converting Web applications ...........................................................118 Running Web applications side-by-side ..........................................120 Using Visual Studio 2010 with .NET 2.0 .....................................................122 Book III: Coding ....................................................... 125 Chapter 1: Programming with Visual Studio 2010 . . . . . . . . . . . . . . . .127 Using the Code Editor .................................................................................127 Simplifying your common tasks .......................................................128 Using visual cues................................................................................136 Browsing and navigating code .........................................................137 Exploring Visual Basic and C# ...................................................................138 Organizing programs .........................................................................138 Getting started ...................................................................................140 Chapter 2: Understanding Data Types . . . . . . . . . . . . . . . . . . . . . . . . . .145 The Rules of Data Types .............................................................................145 Making a Declaration ...................................................................................146 The .NET Framework’s Common Type System .......................................148 Understanding the type hierarchy ..................................................148 Throwing it on the stack or the heap ..............................................149 Completing your assignments ..........................................................150 Popular value types ...........................................................................152 Popular reference types ....................................................................155 Creating Your Own Types ..........................................................................155 When There’s More than One ....................................................................158 Using arrays ........................................................................................159 Using System.Collections ..................................................................161 Iterating through arrays and collections ........................................164 Collections in the real world ............................................................165 Converting Types ........................................................................................166 Meet the Nullable Types .............................................................................168 Browsing Types ...........................................................................................169 Setting the scope................................................................................170 Setting the view ..................................................................................171 Viewing data types.............................................................................172 Viewing source code .........................................................................174 Accessing Types in Your Source Code .....................................................176 0022__553399443399--ffttoocc..iinndddd xxiiii 55//2211//1100 11::4466 PPMM

Description:
A comprehensive, easy-to-understand guide to Visual Studio 2010 Visual Studio is Microsoft's comprehensive development environment that encompasses the .NET Framework, various programming languages, and ASP.NET. Programmers love it for developing applications for mobile devices and the Web. Because
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.