ptg
Effective C#
50 Specific Ways to Improve
Your C#
Second Edition
Bill Wagner
Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City
ptg
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and the publisher was aware of a
trademark claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases
or special sales, which may include electronic versions and/or custom covers and content particular
to your business, training goals, marketing focus, and branding interests. For more information,
please contact:
U.S. Corporate and Government Sales
(800) 382-3419
corpsales@pearsontechgroup.com
For sales outside the United States please contact:
International Sales
international@pearson.com
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data
Wagner, Bill.
Effective C# : 50 specific ways to improve your C# / Bill Wagner.–2nd ed.
p. cm.
Includes index.
ISBN 978-0-321-65870-8 (pbk. : alk. paper)
1. C# (Computer program language) 2. Database management. 3. Microsoft .NET Framework.
I. Title.
QA76.73.C154W343 2010
005.13'3–dc22
2009052199
Copyright © 2010 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copy-
right, and permission must be obtained from the publisher prior to any prohibited reproduction,
storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical,
photocopying, recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax: (617) 671-3447
ISBN-13: 978-0-321-65870-8
ISBN-10: 0-321-65870-1
Te x t p r i n t e d i n t h e U n i t e d S t a t e s o n r e c y c l e d p a p e r a t C o u r i e r i n S t o u g h t o n , M a s s a c h u s e t t s .
First printing, March 2010
ptg
To my parents, Bill and Alice Wagner.
They continue to demonstrate great strength and inspiration.
ptg
This page intentionally left blank