Whether you’re a total novice or a programmer shifting to C#, the newest version of this programming language is full of cool features you’ll want to use. With its Visual Studio compatibility, C# is the perfect language for building Windows Vista applications. And the 2008 version works with LINQ, a query language with syntax similar to SQL but which simplifies database code and can also write queries on XML files. For the best basic C# how-to, it’s hard to beat C# 2008 For Dummies. This plain-English guide to programming with C# can have you creating your first console application before you finish Part I. In fact, the basic template you create at that point will be the foundation of many other apps as you move through the book. Along the way you’ll get the scoop on organizing your data, object-oriented programming (also known as OOP), and a great LINQ-related feature called delegates and events. You’ll find out how to
- Create a console application template
- Perform logical comparisons
- Work with loops and if statements
- Understand collection syntax
- Use interfaces and object-oriented concepts
- Apply delegates and events, and much more
You’ll even gain some rare insight into how to understand error messages you may get when programming in C#. All the code you need can be found on the companion Web site, along with great bonus information that helps you do more with C# 2008. So — what are you waiting for? Grab C# 2008 For Dummies and let’s get started!
Table of Contents:
Introduction 1
Part I: Getting Started with C# 9
Chapter 1: Creating Your First C# Console Application 11
Part II: Basic C# Programming 25
Chapter 2: Living with Variability — Declaring Value-Type Variables 27
Chapter 3: Smooth Operators 49
Chapter 4: Getting into the Program Flow 61
Chapter 5: Lining Up Your Ducks with Collections 89
Chapter 6: Pulling Strings 117
Part III: Using Objects 147
Chapter 7: Showing Some Class 149
Chapter 8: We Have Our Methods 161
Chapter 9: Let Me Say This about this 191
Chapter 10: Object-Oriented Programming — What’s It All About? 209
Part IV: Object-Oriented Programming 217
Chapter 11: Holding a Class Responsible 219
Chapter 12: Inheritance — Is That All I Get? 251
Chapter 13: Poly-what-ism? 275
Chapter 14: Interfacing with the Interface 303
Part V: Now Showing in C# 3.0 331
Chapter 15: Delegating Those Important Events 333
Chapter 16: Mary Had a Little Lambda Expression 353
Chapter 17: LINQing Up with Query Expressions 367
Part VI: The Part of Tens 403
Chapter 18: Ten Common Build Errors (And How to Fix Them) 405
Index 417
About the Author :
Stephen R. Davis, who goes by the name of Randy, lives with his wife and son near Dallas, Texas. He and his family have written numerous books, including C++ For Dummies and C++ Weekend Crash Course. Stephen works for L-3 Communications. Chuck Sphar escaped Microsoft’s C++ documentation camps in 1997, after six years’ hard labor as a senior technical writer. He’s perpetrated three previous tomes, one on object-oriented programming for the Mac, one on Microsoft’s MFC class library, and C# 2005 For Dummies, a revision of Randy’s original edition. He’s currently finishing a novel about ancient Rome (against rome.com) and gobbling great mouthfuls of .NET programming. Chuck can be reached for praise and minor nits at chuck@csharp102.info.