Binding a DataSet to a Control
One of the most exciting aspects of DataSets is that they can be bound to a control. This allows controls to automatically display the data within a DataSet without you having to write any specific code. Let's walk through an example of how to do this using a simple application.
First, create a new Windows application project. On the main form in the Form Designer window, drag the authors table from the Server Explorer window onto the main form exactly as described in the previous chapter. (This involves navigating the Server Explorer tree into the installed SQL Server database installed on your machine—assuming you have SQL Server.) This adds a SqlDataConnection and a SqlDataAdapter to the Form class. Update the ...
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