Binding Controls with Code
The examples presented in this chapter use connections, data adapters, DataSets, and DataViews defined at design time to interact with the database. There’s nothing magic about creating these objects at design time, however. All the Visual Basic development environment does is insert code in a region named “Windows Form Designer Generated Code” at the beginning of your program. If you look near the top of your source file, you can find this section. Click on the plus sign to its left to expand the region and look at the code. If you look closely, you will find all these objects defined and initialized in that section.
Instead of creating all these objects at design time, you can write code to create them at runtime. ...
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