Home > Store

Introduction to C# Using .NET

Register your product to gain access to bonus material or receive a coupon.

Introduction to C# Using .NET

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Practical, step-by-step coverage.
    • Provides students with an easy-to-follow presentation of material. Ex.___

  • Object-oriented programming.
    • Enables students unfamiliar with “thinking in objects” to learn effective object-oriented programming techniques in C#. Ex.___

  • C# and .NET Framework—Central role of several generic interfaces.
    • Provides students with a deep understanding of how .NET augments the features in the language. Ex.___

  • .NET Framework for building applications.
    • Provides students with a practical introduction to the most important classes. Ex.___

  • Hands-on programming.
    • Introduces students to programming using C# to do simple input, computation and output. Ex.___

  • Classes and functions in C# essentials.
    • Provides overview of key classes and functions. Ex.___

  • Memory management.
    • Introduces students to value types with boxing and unboxing operations. Ex.___

  • .NET class library.
    • Helps students get started building applications. Ex.___

  • Data management—In-memory data structures, files and databases.
    • Introduces students to ASP.NET. Ex.___

Description

  • Copyright 2002
  • Dimensions: 7" x 9-1/4"
  • Pages: 480
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-041801-3
  • ISBN-13: 978-0-13-041801-2

This expert, real-world introduction to Microsoft C# shows developers how to make the most of the language's strong object orientation. Unlike many .NET language books, which attempt to cover both the language and .NET in equal measure, this book focuses exclusively on C# and its key interactions with the .NET framework. By concentrating on C#, it can offer far greater detail and many more practical examples than competitive books. Using a running case study, Robert Oberg walks through every stage of creating a complete system using C# and .NET. Along the way, Oberg explores several important interactions between C# and the .NET Framework, and presents detailed introductions to key classes for database integration, Web development, XML, and user interface programming. Introduction to C# Using .NET is one of a breakthrough series of focused guides to .NET written by expert practitioners and instructors. All books in the Oberg.Net Series teach in a systematic, step-by-step manner, using rich examples and a shared case study. They integrate perfectly: developers who complete this book can deepen their .NET development skills with the follow-up title, Application Development Using C# and .NET.

Sample Content

Table of Contents

(NOTE: Each chapter concludes with a Summary.)

Preface.


Organization.


Sample Programs.


Exercises.


Website.


Acknowledgments.


About This Series.

I. INTRODUCTION TO .NET AND C#.

1. .NET Framework.

.NET: What You Need to Know. What Is Microsoft .NET? .NET Framework Overview. Common Language Runtime.

2. First C# Programs.

Hello, World. Program Structure. Namespaces. Variables and Expressions. Using C# As A Calculator. Input/Output in C#. The .NET Framework Class Library.

3. Visual Studio.NET.

Overview of Visual Studio.NET. Project Configurations.Debugging.

II. C# AS A LANGUAGE IN THE C FAMILY.

4. Simple Data Types.

Data Types. Integer Types. Floating-Point Types. Decimal Type. Character Type. Boolean Type. Conversions.

5. Operators and Expressions.

Operator Cardinality. Arithmetic Operators. Relational Operators. Conditional Logical Operators. Bitwise Operators. Assignment Operators. Expressions. Checked and Unchecked.

6. Control Structures.

If Tests. Loops. Preview of Arrays and Foreach. More About Control Flow. Switch Statement.

III. C# PROGRAMMING FUNDAMENTALS.

7. Object-Oriented Programming.

Objects. Classes. Polymorphism. Object-Oriented Languages. Components.

8. Classes.

Classes as Structured Data. Methods. Constructors and Initialization. Static Fields and Methods. Constant and Readonly Fields.

9. The C# Type System.

Overview of Types in C#. Value Types. Reference Types. Default Values. Boxing and Unboxing.

10. Methods, Properties, and Operators.

Methods. Parameter Passing. Method Overloading. Variable Length Parameter Lists. Properties. Operator Overloading.

11. Characters and Strings.

Characters. Strings. String Methods. String Builder Class. Programming with Strings.

12. Arrays and Indexers.

Arrays. System.Array. Random Number Generation. Jagged Arrays. Rectangular Arrays. Arrays as Collections. Bank Case Study: Step 1. Indexers.

13. Inheritance.

Inheritance Fundamentals. Access Control. Method Hiding. Initialization. Bank Case Study: Step 2.

14. Virtual Methods and Polymorphism.

Virtual Methods and Dynamic Binding. Method Overriding. Polymorphism. Abstract Classes. Sealed Classes. Heterogeneous Collections. Case Study: Step 3.

15. Formatting and Conversion.

ToString. Format Strings. String Formatting Methods. Bank Case Study: Step 4. Type Conversions.

16. Exceptions.

Exception Fundamentals. User-Defined Exception Classes. Structured Exception Handling. Bank Case Study: Step 5. Inner Exceptions.

17. Interfaces.

Interface Fundamentals. Programming with Interfaces. Dynamic Use of Interfaces. Bank Case Study: Step 6. Resolving Ambiguity.

IV. C# AND THE .NET FRAMEWORK.

18. Interfaces and the .NET Framework.

Collections. Bank Case Study: Step 7. Copy Semantics and Icloneable. Comparing Objects. Understanding Frameworks.

19. Delegates and Events.

Delegates. Stock Market Simulation. Events.

20. Advanced Features.

Directories and Files. Multiple Thread Programming. Attributes. Custom Attributes. Reflection. Unsafe Code.

21. Components and Assemblies.

Building Components Using .NET SDK. Assemblies. Multiple Language Applications. Building Components Using Visual Studio.NET. Bank Case Study: Componentized Version. Interoperating with COM.

22. Introduction to Windows Forms.

Windows Forms. Simple Forms Using .NET SDK. Windows Forms Event Handling. Menus. Next Steps in Windows Forms and .NET.

Appendix A: Learning Resources.
Index.

Preface

Preface

Microsoft's .NET is a revolutionary advance in programming technology that greatly simplifies application development and is a good match for the emerging paradigm of Web-based services as opposed to proprietary applications. Part of this technology is a new language, C#. This new language combines the power of C++ and the ease of development of Visual Basic(TM). It bears striking resemblance to Java(TM) and improves upon that language. C# may well become the dominant language for building applications on Microsoft(R) platforms.

This book is a practical introduction to programming in C# utilizing the services provided by .NET. This book emphasizes the C# language. It is part of the Prentice Hall/Object Innovations series of books on .NET technology.

This book is intended to be fully accessible to programmers who do not already have a strong background in object-oriented programming in C-like languages such as C++ or Java. It is ideal, for example, for Visual Basic or COBOL programmers who desire to learn C#. The book may also be read by more experienced programmers who desire a simple and concise introduction to C# with many example programs. It is structured so that more ex-perienced programmers can cleanly skip the material they already know. Although designed for working professionals, the book includes enough de-tail, careful explanations and sample programs so that it can be useful as a college textbook.

An important thrust of this book is to teach C# programming from an object-oriented perspective. It is often difficult for programmers trained originally in a procedural language to start "thinking in objects." This book introduces object-oriented concepts early, and C# is developed in a way that leverages its object-orientation. A banking system case study is used to illustrate creating a complete system using C# and .NET. Besides supporting traditional object-oriented features such as classes, inheritance, and polymorphism, C# introduces several additional features, such as properties, indexers, delegates, events, and interfaces that make C# a compelling language for developing object-oriented and component-based systems. This book provides thorough coverage of all these features.

C# as a language is elegant and powerful. But to fully utilize its ca-pabilities you need to have a good understanding of how it works with the .NET Framework. The book explores several important interactions between C# and the .NET Framework, and it includes an introduction to major classes for collections, files, threads, and user interface.

ORGANIZATION

The book is organized into four major parts and is structured in a manner to make it easy for you to navigate to what you most need to know. Part 1, which should be read by everyone, begins with an introduction to the .NET Framework, which is the underpinning for all applications and services in the .NET environment. Next comes a short introduction to hands-on pro-gramming using C#, so that you can start writing code on .NET right away. The third chapter introduces Visual Studio.NET, the latest incarnation of Microsoft's popular Visual Studio development environment. The new Visual Studio has many features that make application development easier and more pleasant. You will be equipped to use Visual Studio throughout the rest of the book.

Part 2 covers the C-like features of C#, which are shared by C, C++, Java, and various scripting languages. Thus, if you know any of these C-like languages, you will have a definite leg up in learning C#, and you can quickly skim this section, paying attention to the information in the side-bars. A sidebar will alert you the first time a concept new to C# is intro-duced. Then you will know to look for further elaborations where they occur later. If you are not familiar with C or a similar language, this section is for you. It will quickly bring you up to speed on the core topics of data types, operators, and control structures.

Part 3 is the core of the book, systematically covering the features of the C# programming language that go beyond C. The object-oriented features of C# are covered gradually and thoroughly, making this part of the book accessible to readers without OOP background. A case study is used, illustrating how the object-oriented features of C# work in combination. This case study is progressively built from Chapters 12 through 18. The C# data types, based on the .NET Common Type System, are explored in detail. We cover features new in C# such as properties and indexers. We cover prac-tical issues of formatting and conversions, and we discuss the important topic of exceptions. We conclude this part with a study of interfaces, which provide a better level of abstraction in expressing system functionality.

Part 4 explores thoroughly the relationships between C# and the .NET Framework and introduces some important .NET services. We introduce collections, which generalize arrays, and we examine fundamental operations such as copying and comparing objects. In .NET, interfaces are provided for such basic operations, which makes for a very flexible architecture, as different classes can implement these interfaces in a manner appropriate for them. The .NET Framework provides a very flexible callback mechanism, known as delegates, which has many applications. Delegates are the foundation of events, and they are also used in starting threads. We look at directories and files, multiple thread programming, and attributes. Attributes are a powerful mechanism in .NET, enabling the programmer to accomplish tasks declaratively, with writing little or no code. You can implement your own custom attributes in C#. You can read information about custom attributes, or any other metadata, by a mechanism known as "reflection." C# permits you to code at a lower level by writing "unsafe" code, which can help you interoperate with legacy code. The book concludes with introductions to components and to Windows programming.

SAMPLE PROGRAMS

The only way to really learn a programming language is to read and write many, many programs, including some of reasonable size. This book provides many small programs that illustrate pertinent features of C# in iso-lation, where they are easy to understand. The programs are clearly labeled in the text, and they can all be found in the software distribution that ac-companies this book. Directions for downloading the software are given be-low.

There is also a major case study, that is progressively developed in Chapters 12 through 18. This case study illustrates many features of C# working together in combination, as they would in a practical application. A special point is made of demonstrating the object-oriented features of C#. If you are new to OO, studying the case study is a must!

The sample programs are provided in a self-extracting file. When ex-panded, a directory structure is created rooted in c:\OI\CSharp. The sample programs are in directories Chap1, Chap2, etc. All the samples for a given chapter are in individual folders within the chapter directories. The names of the folders are clearly identified in the text. Each chapter that contains a step of the case study has a folder CaseStudy containing that step.

This book is part of the Integrated .NET Series from Object Innovations and Prentice Hall PTR series. The sample programs for other books in the series are located in their own directory underneath c:\OI, so all the .NET examples from all books in the series will be located in a common area as you install them.

EXERCISES

Although exercises are not provided in the book itself, a comprehensive set of exercises is available for download from our website.

WEBSITE

The website for the Integrated .NET Series from Object Innovations and Prentice Hall PTR series is:
www.objectinnovations.com/dotnet.htm

A link is provided at that website for downloading the sample programs.

Updates

Updates & Corrections

Untitled Document If a printing error has occurred in your copy, please download Pages 364-365 here.

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020