Sams Teach Yourself C# in 24 Hours
- Table of Contents
- Copyright
- About the Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- Audience and Organization
- Conventions Used in This Book
- Onward and Upward!
- Part I. The Visual Studio Environment
- Hour 1. A C# Programming Tour
- Hour 2. Navigating C#
- Hour 3. Understanding Objects and Collections
- Hour 4. Understanding Events
- Part II. Building a User Interface
- Hour 5. Building FormsPart I
- Hour 6. Building FormsPart II
- Hour 7. Working with the Traditional Controls
- Hour 8. Advanced Controls
- Hour 9. Adding Menus and Toolbars to Forms
- Hour 10. Drawing and Printing
- Part III. Making Things HappenProgramming!
- Hour 11. Creating and Calling Methods
- Hour 12. Using Constants, Data Types, Variables, and Arrays
- Hour 13. Performing Arithmetic, String Manipulation, and Date/Time Adjustments
- Hour 14. Making Decisions in C# Code
- Hour 15. Looping for Efficiency
- Hour 16. Debugging Your Code
- Hour 17. Designing Objects Using Classes
- Hour 18. Interacting with Users
- Part IV. Working with Data
- Hour 19. Performing File Operations
- Hour 20. Controlling Other Applications Using Automation
- Hour 21. Working with a Database
- Part V. Deploying Solutions and Beyond
- Hour 22. Deploying a Solution
- Hour 23. Introduction to Web Development
- Hour 24. The 10,000-Foot View
- Appendix A. Answers to Quizzes/Exercises
Namespaces
The base namespace in the .NET Framework is the System namespace. The System namespace contains classes for garbage collection (discussed shortly), exception handling, data typing, and so much more. The System namespace is just the tip of the iceberg. There are literally dozens of namespaces. Table 24.1 lists some of the more common namespaces, many of which you've used in this book. All the controls that you've placed on forms and even the forms themselves, for example, belong to the System.Windows.Forms namespace. Use Table 24.1 as a guide; if a certain namespace interests you, I suggest that you research it further in the Visual Studio .NET online help.
Table 24.1. Commonly Used Namespaces
| Namespace | Description |
| Microsoft.CSharp | Contains classes that support compilation and code generation using the C# language. |
| Microsoft.VisualBasic | Contains classes that support compilation and code generation using the Visual Basic language. |
| System | Contains fundamental classes and base classes that define commonly used value and reference data types, event handlers, interfaces, attributes, and exceptions. This is the base namespace of .NET. |
| System.Data | Contains classes that constitute the ADO.NET architecture. |
| System.Diagnostics | Contains classes that enable you to debug your application and to trace the execution of your code. |
| System.Drawing | Contains classes that provide access to the Graphical Device Interface (GDI) basic graphics functionality. |
| System.IO | Contains classes that allow reading from and writing to data streams and files. |
| System.Net | Contains classes that provide a simple programming interface to many of the protocols found on the network. |
| System.Security | Contains classes that provide the underlying structure of the CLR security system. |
| System.Web | Contains classes that provide interfaces that enable browser/server communication. |
| System.Windows.Forms | Contains classes for creating Windows-based applications that take advantage of the rich user-interface features available in the Microsoft Windows operating system. |
| System.Xml | Contains classes that provide standards-based support for processing XML. |
Common Type System | Next Section

Account Sign In
View your cart