OTHER DATA OBJECTS
If you want a simple program that can display and modify data, then the solution described in the previous sections may be good enough. In that case, you can let Visual Basic do most of the work for you, and you don’t need to dig into the lower-level details of database access.
You can also use objects similar to those created by Visual Basic to build your own solutions. You can create your own DataSet, TableAdapter, BindingSource, and BindingNavigator objects to bind controls to a database. (You can even modify the controls supplied by Visual Basic by overriding their properties and methods, although that’s a very advanced topic so it isn’t covered here.)
If you need to manipulate the database directly with code, it doesn’t necessarily make sense to create all these objects. If you simply want to modify a record programmatically, it certainly doesn’t make sense to create DataGridView, BindingNavigator, and BindingSource objects.
For cases such as this, Visual Basic provides several other kinds of objects that you can use to interact with databases. These objects fall into the following four categories:
- Data containers hold data after it has been loaded from the database into the application much as a DataSet does. You can bind controls to these objects to automatically display and manipulate the data.
- Connections provide information that lets the program connect to the database.
- Data adapters move data between a database and a data container.
- Command objects ...
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