AUTOMATICALLY CREATED OBJECTS
When you drag database tables and columns from the Data Sources window onto a form, Visual Basic does a lot more than simply place a DataGridView control on a form. It also creates about two dozen other controls and components. Five of the more important of these objects are the DataSet, TableAdapter, TableAdapterManager, BindingSource, and BindingNavigator.
The program stores data in a DataSet object. A single DataSet object can represent an entire database. It contains DataTable objects that represent database tables. Each DataTable contains DataRow objects that represent rows in a table, and each DataRow contains DataColumn objects representing column values for the row.
The TableAdapter object copies data between the database and the DataSet. It has methods for performing operations on the database such as selecting, inserting, updating, and deleting records. Hidden inside the TableAdapter is a connection object that contains information on the database so that the TableAdapter knows where to find it.
The TableAdapterManager coordinates updates among different TableAdapters. This is most useful for hierarchical data sets, a topic that is outside the scope of this book. The wizard-generated code also uses the TableAdapterManager to update the single data set it creates.
The BindingSource object encapsulates all of the DataSet object’s data and provides programmatic control functions. These perform such actions as moving through the data, adding ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access