![]() ![]() | ||
How do you create a dataset in code, then bind it to a data grid? To see how this works, take a look at the DataSetCode example on the CD-ROM, which I'll cover in the next few topics in this chapter. This example creates a connection object, a command object, a data adapter, and a dataset corresponding to the authors table in the pubs sample database, and then binds and displays that table in a data grid, as you see in Figure 22.1.
To see how this example works, look at the next few topics.
Note |
This example uses a data connection and data adapter to retrieve data from a database. If you want to create a dataset entirely from scratch, no data connection needed, see "Creating a Data Table in Code" in this chapter. |
Related solution: |
Found on page: |
---|---|
861 |
![]() ![]() | ||