Previous Page
Next Page

Chapter 24
Working with Data Binding and DataSets
After completing this chapter, you will be able to:

In Chapter 23, “Using a Database,” you learned the essentials of using Microsoft ADO.NET for executing queries and updating databases. You used a DataSet to retrieve data from the Suppliers and Products tables and display it in a master/details form. You achieved this simply by using the Data Source Configuration Wizard, configuring DataTable classes, and dragging and dropping DataTable classes onto a form to generate DataSet, BindingSource, TableAdapter, and BindingNavigator controls. You actually wrote very little code to do all of this. In this chapter, you will write C# statements that perform many of these tasks—this will help you to understand what Microsoft Visual Studio 2005 is doing for you, and enable you to write more complex applications that can achieve more functionality than can be generated by using drag and drop techniques alone.

In this chapter, you'll learn more about data binding—linking a control property to a data source. You will learn how to dynamically bind properties of controls to a DataSet by using simple data binding. You will also learn how to use complex data binding with the ComboBox and ListBox controls. You will learn a lot more about how to design DataSet classes and use DataSet objects in code. In particular, you will learn how to use DataSet objects with the DataGridView control to update a database in an efficient manner.


Previous Page
Next Page