Y L F M A E T Team-Fly® C# Professional Projects This page intentionally left blank C# Geetanjali Arora Balasubramaniam Professional Projects Aiaswamy Nitin Pandey WITH ©2002 by Premier Press,Inc.All rights reserved.No part of this book may Publisher: be reproduced or transmitted in any form or by any means, electronic or Stacy L.Hiquet mechanical,including photocopying,recording,or by any information stor- Marketing Manager: age or retrieval system without written permission from Premier Press, Heather Buzzingham except for the inclusion of brief quotations in a review. Managing Editor: The Premier Press logo,top edge printing,and related trade dress Sandy Doell are trademarks of Premier Press,Inc.and may not be used with- out written permission. All other trademarks are the property of Editorial Assistant: their respective owners. Margaret Bauer Important:Premier Press cannot provide software support.Please contact the Book Production Services: appropriate software manufacturer’s technical support line or Web site for Argosy assistance. Cover Design: Premier Press and the author have attempted throughout this book to dis- MikeTanamachi tinguish proprietary trademarks from descriptive terms by following the cap- italization style used by the manufacturer. Information contained in this book has been obtained by Premier Press from sources believed to be reliable.However,because of the possibility of human or mechanical error by our sources,Premier Press,or others, the Publisher does not guarantee the accuracy,adequacy,or completeness of any informa- tion and is not responsible for any errors or omissions or the results obtained from use of such information.Readers should be particularly aware of the fact that the Internet is an ever-changing entity. Some facts may have changed since this book went to press. ISBN:1-931841-30-6 Library of Congress Catalog Card Number:2001096998 Printed in the United States of America 02 03 04 05 06 RI 10 9 8 7 6 5 4 3 2 1 About NIIT NIIT is a global IT solutions corporation with a presence in 38 countries. With its unique business model and technology-creation capabilities, NIIT delivers software and learning solutions to more than 1,000 clients across the world. The success of NIIT’s training solutions lies in its unique approach to education. NIIT’s Knowledge Solutions Business conceives, researches, and develops all of its course material. A rigorous instructional design methodology is followed to create engaging and compelling course content. NIIT trains over 200,000 executives and learners each year in information technology a reas using stand-up tra i n i n g, video-aided instruc t i o n, c omputer-based tra i n i n g (CBT), and Internet-based training (IBT). NIIT has been featured in the Guinness Book ofWorld Recordsfor the largest number of learners trained in one year! NIIT has developed over 10,000 hours of instructor-led training (ILT) and over 3,000 hours of Internet-based training and computer-based training. IDC ranked NIIT among the Top 15 IT training providers globally for the year 2000. Through the inno- vative use of training methods and its commitment to research and development,NIIT has been in the forefront of computer education and training for the past 20 years. Quality has been the prime focus at NIIT.Most of the processes are ISO-9001 certi- fied. It was the 12th company in the world to be assessed at Level 5 of SEI-CMM. NIIT’s Content (Learning Material) Development facility is the first in the world to be assessed at this highest maturity level.NIIT has strategic partnerships with compa- nies such as Computer Associates,IBM,Microsoft,Oracle,and Sun Microsystems. This page intentionally left blank About the Authors Geetanjali Arora is an instructional designer who has worked with the NIIT for almost two years.She has done several projects with the NIIT that include instructor- led training (ILT),computer-based training (CBT),and Web-based training (WBT). She has written on both technical and non-technical subjects. At the NIIT, Geentanjali’s responsibilities include scripting, construction, planning, and schedul- ing.She has also provided training on NexGen and Dreamweaver. Balasubramaniam Aiaswamy is a technical trainer and writer, an instructional designer,a subject matter expert (SME),and an ID reviewer with NIIT’s Knowledge Solutions Business division,which develops and reviews instructor-led training (ILT) products for various software and technologies.These technologies include Microsoft Visual InterDev 6.0, Microsoft Site Server 3.0 Commerce Edition,Microsoft Win- dows CE, Java 2 Micro Edition (J2ME),networking concepts,the installation and administration of a Layer 3 network,andWeb security.He is both an MCSD and an MCP in Windows NT.Balasubramaniam has experience in teaching career programs at NIIT’s Career Education Group division.He has taught various technical subject areas including networking essentials, SQL Server 7.0, Microsoft Windows NT Server 4.0, MicrosoftVisual Basic 6.0, Microsoft Visual C++ 4.0, Windows 32 API programming,HTML,Java,Unix,C,and C++.He has also set up and managed labs for students and administered Novell 3.11 and UNIX (SCO)–based networks. Nitin Pandey works with NIIT as a subject matter expert (SME) for learning con- tent developed on Microsoft technologies. Nitin has been involved in the develop- ment of WBTs and seminars for NIIT Online Ltd. and Microsoft. Nitin provides technical support to the development teams, develops sample applications,and pro- vides technical reviews of learning content. This page intentionally left blank Contents at a Glance Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi Part I Introduction to C# . . . . . . . . . . . . . . . . . . . . . . 1 1 Overview of the .NET Framework . . . . . . . . . . . . . . . . . . . 3 2 C# Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Part II Handling Data . . . . . . . . . . . . . . . . . . . . . . . . 41 3 Components of C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4 More about Components . . . . . . . . . . . . . . . . . . . . . . . . . 67 5 Attributes and Properties. . . . . . . . . . . . . . . . . . . . . . . . . . 83 6 Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Part III Professional Project 1: Creating a Customer Maintenance Project. . 109 7 Project Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 8 Windows Forms and Controls. . . . . . . . . . . . . . . . . . . . . 141 9 Validations and Exception Handling. . . . . . . . . . . . . . . . 175 10 Database Interaction Using ADO.NET . . . . . . . . . . . . . 197 11 Crystal Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 12 Deploying a Windows Application . . . . . . . . . . . . . . . . . 259 Part IV Professional Project 2: Creating the Employee Records System (ERS) Project. . . 293 13 Project Case Study and Design . . . . . . . . . . . . . . . . . . . . 297 14 Implementing the Business Logic . . . . . . . . . . . . . . . . . . 311 Part V Professional Project 3: Creating a Creative Learning Project. . . . . . 329 15 Project Case Study and Design . . . . . . . . . . . . . . . . . . . . 333 16 Implementing the Programming Logic . . . . . . . . . . . . . . 349 17 Interacting with a Microsoft Word Document and Event Viewer . . . . . . . . . . . . . . . . . . . . . 365
Description: