Programmatically Configuring a DataAdapter Using the CommandBuilder

Sometimes, you cannot know at design time exactly how your Data Adapter will be configured. The configuration might depend on user input or data in another table. You may want to use dynamic SQL where you build your statements at runtime instead of using replaceable parameters. This is especially useful in a query generator search screen where you do not know in advance what the user wants to search for.

Create a Windows Forms project called ADOBook06-02. (Or get it from the web site.) If you want to work along, use the starter project, otherwise you can just follow along. We’ll be using the same interface as the last project, so you can make a copy of it and delete the DataAdapter ...

Get ADO.NET Programming in Visual Basic™ .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.