Our Ironclad Guarantee
You must be satisfied. Try our print books for 30 days or our eBooks for 14 days. If they aren't the best you've ever used, you can return the books or cancel the eBooks for a prompt refund. No questions asked!
This is the 2015 edition of our best-selling C# book. The newest edition is Murach's C# (7th Edition).
This book focuses on how to develop professional Windows Forms applications with C#. But along the way, it teaches you the C# language and core skills that you’ll use to develop any C# application...whether for Windows, the web, or mobile devices.
Go to our instructor’s site to learn more about this book and its instructor’s materials.
Best C# book ever. Murach manuals are precise and to the point, with lots and lots of examples. Highly recommended for beginners."
This book is for anyone who wants to learn how to use C# 2015 to develop Windows Forms applications.
This is a great first book in C#, whether you’re a programming novice or an experienced programmer. What follows are 5 reasons why that’s true.
But what if you’ve already read 3 or 4 other C# books and still don’t know how to build a professional C# application? Then these 5 reasons point out what you’ve been missing and why this is the right book for you, too.
This book starts you off using all the best features of Visual Studio so you can begin productive work almost immediately. In fact, it has you create a simple business application in chapters 2 and 3 so you can see right away how the core features of C# and of Visual Studio work.
When it comes to object-oriented programming, too many C# books resort to whimsical but useless metaphors, like illustrating objects by creating animal classes such as mammals, cats, and dogs. Then, they leave it up to you to figure out how to transfer these concepts to business applications.
In contrast, this book presents business objects such as customers, invoices, and products so you can see how OOP is used to create multi-tiered applications in the real world.
Learning to use C# classes and OOP techniques isn’t enough. You also have to know how to code for the tasks that are required in most business applications.
That’s why this book builds on your skills in incremental steps to teach you how to validate data; handle numeric, date, and string data; work with loops, arrays, and collections; code methods and event handlers; handle exceptions; and work with text, binary, and XML data.
You can’t create business applications without handling databases.
So this book teaches you how to create database applications using C# tools like data sources and data-handling controls that are designed for rapid application development and prototyping. It includes introductions to ADO.NET coding and the Entity Framework that give you more control over database processing than what the RAD tools offer. And it introduces you to LINQ, a feature that lets you query almost any data structure…not just databases…using the C# language.
This is powerful stuff that’s glossed over in most other C# books.
This book presents complete, non-trivial applications that illustrate what you need to know on the job. Studying applications like these is the key to mastering C# development, but you won’t find them in many other C# books.
C# is a mature product. So the basics of developing Windows applications using C# and Visual Studio haven’t changed.
Still, there are always new features to cover and improvements to make in each edition of our book! So we’ve:
The appendix in the book shows you how to install Visual Studio 2015, regardless of the edition you choose.
The Professional Edition and the Enterprise Edition of Visual Studio 2015 are designed for teams of developers. So they include custom options for that market and are priced accordingly.
As you’d expect, both these editions come with everything you need to develop Windows Forms applications with C# 2015. That includes the Visual Studio development environment, version 4.6 of the Microsoft .NET Framework, C# 2015, and a simplified version of SQL Server called SQL Server Express LocalDB.
If you’re learning C# on your own, you can download the Visual Studio 2015 Community Edition for free from Microsoft’s website. It provides everything you need to develop the applications shown in this book, including the Visual Studio development environment, version 4.6 of the Microsoft .NET Framework, C# 2015, and SQL Server Express LocalDB.
If you use this edition, you’ll find that it has just a few minor differences from the Professional Edition of Visual Studio that is the basis for this book. These differences don’t affect how you develop applications with Visual Studio, though. So all of the skills you learn and all of the applications you develop with the Community Edition will still work with the other editions of Visual Studio.
“I have a limited background as a programmer and I needed both an intro to a powerful language as well as a primer on the concepts of object-oriented programming. I have learned more in the 800+ pages of this book than I have reading half a dozen other books and hours of forum posts online.”
- Posted at an online bookseller
“This is a great book to introduce C# programming…. It’s an 883-page book, but it is very easy to read following the traditional ‘Murach Style’ where you learn something on the left page and you can immediately review the short summary, code samples, and effective explanations on the right page.”
- James Lin, SoCal Developer Network
“I've been doing C# development professionally for a couple of years now, but hadn't had the opportunity to check out the new features in the latest version…. If you've read a Murach book, then you're familiar with the format. My habit is to read everything on topics that I don't know much or anything about, and just skim the right pages for topics that I'm more familiar with. I like this format because it makes it easier to find areas that I need to read without going through everything.”
- William Springer, Vulcan Ears Book Reviews
“Murach's book format and content are hard to beat: I've never come across a Murach's book that I didn't like. The format of left page detail and right page code sample is extremely useful, especially for those new to the subject matter at hand. I often recommend Murach's books to those that are just picking up various Microsoft based technologies or that are looking to improve their skills to an intermediate level.”
- Posted at an online bookseller
“This is a great training manual to get newbies up to speed.”
- Ian Ippolito, PlanetSourceCode
View the table of contents for this book in a PDF: Table of Contents (PDF)
Click on any chapter title to display or hide its content.
.NET applications
Visual Studio and the .NET programming languages
The .NET Framework
The Visual Studio IDE
How a C# application is compiled and run
How C# differs from the other .NET languages
How C# differs from Java
How to start Visual Studio
How to open or close an existing project
Some possible menu variations
How to use the Form Designer
How to use the Code Editor
How to use the Solution Explorer
How to work with Visual Studio’s windows
How to build a project
How to run a project
How to upgrade projects created in earlier versions of C#
How to change the .NET Framework version used by a project
How to set the Visual Studio options
How to change the import and export settings
How to create a new project
The design of the Invoice Total form
How to add controls to a form
How to set properties
Common properties for forms and controls
How to add navigation features
The property settings for the Invoice Total form
How to use Document Outline view
How to name the files of a project
How to save the files of a project
Introduction to object-oriented programming
How to refer to properties, methods, and events
How an application responds to events
How to create an event handler for the default event of a form or control
How to delete an event handler
How IntelliSense helps you enter the code for a form
The event handlers for the Invoice Total form
How to detect and correct syntax errors
How to code with a readable style
How to code comments
How to work with the Text Editor toolbar
How to collapse or expand blocks of code
How to zoom in and out
How to highlight symbols
How to print the source code
How to use code snippets
How to refactor code
How to use the annotations in the scroll bar
How to get help information
How to run a project
How to test a project
How to debug runtime errors
The built-in value types
How to declare and initialize variables
How to declare and initialize constants
How to code arithmetic expressions
How to code assignment statements
How to work with the order of precedence
How to use casting
How to use the Math class
How to declare and initialize a string
How to join and append strings
How to include special characters in strings
The .NET structures and classes that define data types
How to use methods to convert data types
How to use methods to convert numbers to formatted strings
How to work with scope
How to declare and use enumerations
How to work with nullable types and the null-coalescing operator
The basic Invoice Total application
The enhanced Invoice Total application
How to use the relational operators
How to use the logical operators
How to code if-else statements
How to code switch statements
An enhanced version of the Invoice Total application
How to code while and do-while loops
How to code for loops
Loops that use break and continue statements
Debugging techniques for programs with loops
The design and property settings for the form
The code for the form
How to code methods
How to call methods
How to use optional parameters
How to use named arguments
How to use refactoring to create a new method and its calling statement
When and how to pass arguments by reference and by value
How to generate an event handler for any event
How event wiring works
How to handle multiple events with one event handler
The event handlers and the CalculateFutureValue method
Some of the generated code
How exceptions work
How to display a dialog box
How to catch an exception
How to use the properties and methods of an exception
How to catch specific types of exceptions
How to throw an exception
The Future Value application with exception handling
How to validate a single entry
How to use generic methods to validate an entry
How to validate multiple entries
The dialog boxes
The code
How to create an array
How to assign values to the elements of an array
How to work with arrays
How to use foreach loops to work with arrays
How to create a rectangular array
How to assign values to a rectangular array
How to work with rectangular arrays
How to create a jagged array
How to assign values to a jagged array
How to work with jagged arrays
How to use the Array class
How to refer to and copy arrays
How to code methods that work with arrays
How to use the null-conditional operator
Commonly used collection classes
Typed vs. untyped collections
How to work with a list
How to work with a sorted list
How to work with queues and stacks
How to work with an array list
How to create a DateTime value
How to get the current date and time
How to format DateTime values
How to get information about dates and times
How to perform operations on dates and times
The properties and methods of the String class
Code examples that work with strings
More code examples that work with strings
How to use the Parse and TryParse methods to validate numeric entries
How to use the StringBuilder class
How to format numbers
How to format dates and times
How to use interpolated strings
Five more types of controls
How to work with combo boxes and list boxes
How to work with check boxes and radio buttons
How to work with group boxes
How to use Tab Order view to set the tab order
How to get the information you need for using a control
How to add a form to a project
The code that’s generated for a new form
How to rename a form
How to display the first form of an application
How to display a form as a dialog box
How to pass data between a form and a custom dialog box
How to display a dialog box and get the user response
How to use the FormClosing event
The operation
The property settings
The code for the Customer form
The code for the Payment form
How to set the debugging options
How to work in break mode
How to use the Edit and Continue feature
How to work with data tips
How to use breakpoints
How to control the execution of an application
How to use the Locals window to monitor variables
How to use the Autos window to monitor variables
How to use Watch windows to monitor expressions
How to use the Immediate window to execute commands
How to use the Call Stack window to monitor called methods
How to use the Call Hierarchy window to navigate through your code
How to use the Output window to view project information
How to write data to the Output window
How use the Visualizer dialog boxes to view strings
How classes can be used to structure an application
The members you can define within a class
The code for the Product class
How instantiation works
How to add a class file to a project
How to code fields
How to code properties
How to code methods
How to code constructors
How to code static members
The operation of the Product Maintenance application
The classes used by the Product Maintenance application
The code for the Product Maintenance application
How to code auto-implemented properties
How to code expression-bodied properties and methods
How to generate code stubs
How to browse the classes in a solution
How to use class diagrams and the Class Details window
How to use the Peek Definition window
How to create a structure
How to use a structure
The code for a simple ProductList class
The specifications for the enhanced ProductList class
How to create an indexer
How to throw an argument exception
How to define and use a delegate
How to define and use events
How to use anonymous methods and lambda expressions with delegates and events
An introduction to operator overloading
How to overload arithmetic operators
How to overload relational operators
The code for the ProductList class
The code for the Product Maintenance form
How inheritance works
How the .NET Framework uses inheritance
Methods inherited from the System.Object class
How to use inheritance in your applications
How to create a base class
How to create a subclass
How polymorphism works
The operation of the Product Maintenance application
The code for the Product, Book, and Software classes
The code for the ProductList class
The code for the Product Maintenance form
The code for the New Product form
How to use the Type class to get information about an object’s type
How to use casting with inheritance
How to work with abstract classes
How to work with sealed classes
An introduction to interfaces
Some of the interfaces defined by the .NET Framework
How to create an interface
How to implement an interface
A Product class that implements the ICloneable interface
How to use an interface as a parameter
How to code a class that defines a generic collection
Some of the generic interfaces defined by the .NET Framework
How to implement the IComparable<> interface
How to use constraints
How to implement the IEnumerable<> interface
How to code an interface that uses generics
How to code multiple classes in a single file
How to split a single class across multiple files
How to work with namespaces
How to add XML documentation to a class
How to view the XML documentation
How class libraries work
How to create a class library project
How to add a reference to a class library
How to use the classes in a class library
The hardware components of a client/server system
The software components of a client/server system
How a table is organized
How the tables in a database are related
How the columns in a table are defined
The design of the MMABooks database
How to query a single table
How to join data from two or more tables
How to add, update, and delete data in a table
The .NET data providers
How the basic ADO.NET components work
Concurrency and the disconnected data architecture
How a dataset is organized
How to work with data without using a data adapter
Two ways to create ADO.NET objects
How to use the Data Sources window
How to start the Data Source Configuration Wizard
How to choose a data source type
How to choose the database model for a data source
How to choose the connection for a data source
How to create a connection to a database
How to save a connection string in the app.config file
How to choose database objects for a data source
The schema file created by the Data Source Configuration Wizard
How to generate a DataGridView control from a data source
A Product Maintenance application that uses a DataGridView control
How to change the controls associated with a data source
How to generate detail controls from a data source
A Customer Maintenance application that uses TextBox controls
How to handle data provider errors
How to handle ADO.NET errors
How to handle data errors for a DataGridView control
How to view the schema for a dataset
How to use the Query Builder
How to preview the data for a query
How to interpret the generated SQL statements
How to format the data displayed in a text box
How to bind a combo box to a data source
How to use code to work with a binding source
How to create a parameterized query
How to use code to work with a parameterized query
How to use the Items Collection Editor
How to code an event handler for a ToolStrip item
The user interface
The code
How to modify the properties of a DataGridView control
How to edit the columns of a DataGridView control
How to format the data in the columns of a DataGridView control
How to use a DataGridView control to create a Master/Detail form
The user interface
The dataset schema
The code for the Customer Invoices form
How to create and work with connections
How to create and work with commands
How to use parameters in SQL statements
How to create parameters
How to work with parameters
How to create and work with a data reader
How to execute queries that return a single value
How to execute action queries
The user interface
The class diagram for the business and database classes
The code for the CustomerDB class
The code for the StateDB class
The code for the MMABooksDB class
The code for the Customer Maintenance form
The code for the Add/Modify Customer form
The classes for managing directories, files, and paths
How files and streams work
How to use the FileStream class
How to use the exception classes for file I/O
How to write a text file
How to read a text file
A class that works with a text file
How to write a binary file
How to read a binary file
A class that works with a binary file
An XML document
XML tags, declarations, and comments
XML elements
XML attributes
How to create a new XML file
How to open an existing XML file
How to edit an XML file
How to use the XmlWriter class
Code that writes an XML document
How to use the XmlReader class
How the XmlReader class reads nodes
Code that reads an XML document
A class that works with an XML file
How LINQ is implemented
Advantages of using LINQ
The three stages of a query operation
How to identify the data source for a query
How to filter the results of a query
How to sort the results of a query
How to select fields from a query
How to join data from two or more data sources
How extension methods work
Extension methods used to implement LINQ functionality
How lambda expressions work
How to use lambda expressions with extension methods
The user interface
The code for the form
The dataset schema
The code for the form
How the Entity Framework works
How to start an Entity Data Model with the Entity Data Model Wizard
How to choose the Entity Framework version
How to choose the database objects
The Entity Data Model in the Entity Data Model Designer
Basic skills for using the designer
How to use the Model Browser window
How to use the Mapping Details window
How to retrieve data from a single table
How to query across relationships
How to load related objects
How to update an existing row
How to delete an existing row
How to add a new row
How to provide for concurrency
How to create an object data source
How to bind controls
The user interface
The Entity Data Model
The code for the MMABooksEntity class
The code for the Customer Maintenance form
The code for the Add/Modify Customer form
A single-document interface (SDI)
A multiple-document interface (MDI)
How to use a startup form
How to use a Tab control
How to create menus
How to set the properties that work with menu items
How to write code that works with menu items
How to create parent and child forms
How to write code that works with parent and child forms
How to create a toolbar
How to write code that works with toolbars
How to add tool tips
How to add context-sensitive help
How XCopy works
How ClickOnce works
How a Setup program works
How to create a release build
How to copy the release build to the client machine
How to publish an application
How to select the files that are published
How to select the prerequisites
How to set the update options
How to set the publish options
How to install an application
How to update an application
How to create an InstallShield project
How to use the InstallShield Project Assistant
How to add output files to an InstallShield project
How to create and view the installation files for a Setup program
How to use a Setup program to install an application
Using ClickOnce deployment
Using a Setup program
How to use the downloadable files
How to install Visual Studio 2015
How to use the MMABooks database
This chapter shows you how to use Visual Studio 2015 to design a Windows form that displays the discount amount and final total for an invoice, based on user input and a fixed discount rate. It also tells you how to set the Visual Studio options so it’s easier to create a new project.
This chapter teaches you how to enter the C# code for the Windows form in chapter 2 so the interface works the way you want it to. It also gets you started with practical debugging techniques. And it introduces you to Live Code Analysis, a powerful 2015 feature that helps you identify potential coding problems and improve your code.
Chapter 2 PDF (662Kb) Download Now
Chapter 3 PDF (1.36Mb) Download Now
This download includes:
The appendix in the book shows how to install and use these files.
Exe file for Windows (67.7Mb) Download Now
Zip file for any system (67.7Mb) Download Now
To view the "Frequently Asked Questions" for this book in a PDF, just click on this link: View the questions
Then, if you have any questions that aren't answered here, please email us. Thanks!
To view the corrections for this book in a PDF, just click on this link: View the corrections
Then, if you find any other errors, please email us so we can correct them in the next printing of the book. Thank you!
For orders and customer service:
1-800-221-5528
Weekdays, 8 to 4 Pacific Time
If you're a college instructor who would like to consider a book for a course, please visit our website for instructors to learn how to get a complimentary review copy and the full set of instructional materials.