Oscar
®
Tim Patrick
Published with the authorization of Microsoft Corporation by: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, California 95472 Copyright © 2010 Tim Patrick. Complying with all applicable copyright laws is the responsibility of the user. All rights reserved. Without limiting the rights under copyright, no part of this documentmay be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without express written permission of O’Reilly Media, Inc. Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 WCT 5 4 3 2 1 0 Microsoft Press titles may be purchased for educational,business or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com. Visit our website at microsoftpress.oreilly.com. Send comments to mspinput@microsoft.com. Microsoft, Microsoft Press, ActiveX, Excel, FrontPage, Internet Explorer,PowerPoint, SharePoint, Webdings, Windows, and Windows 7 are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places,and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the author, O’Reilly Media,Inc., Microsoft Corporation, nor their respective resellers or distributors, will be held liable for any damages caused or alleged to be caused either directly or indirectly by such information. Acquisitions and Development Editor: Russell Jones Production Editor: Kristen Borg Production Services: Octal Publishing, Inc. Technical Reviewer: Sahil Malik Indexing: Potomac Indexing, LLC Cover: KarenMontgomery Compositor: Susan Brown Illustrator: Robert Romano
978-0-735-63888-4
To Abel Chan, a good friend and a good programmer.
Contents at a Glance
Part I
Getting to Know ADO.NET
C hapter 1 I ntroducing ADO.NET 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 C hapter 2 B uilding Tables of Data .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 C hapter 3 S toring Data in Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 C hapter 4 A ccessing the Right Data Values . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 59 C hapter 5 B ringing Related Data Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 C hapter 6 T urning Data into Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 C hapter 7 S aving and Restoring Data . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . 107
Part II
Connecting to External Data Sources
121 135 153 169 191
C hapter 8 E stablishing External Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C hapter 9 uerying Databases . . . . . . . . . . . . . . . . . . . . . . . . . . ....
Regístrate para leer el documento completo.