Spread Windows Forms 6.0 Product Documentation
Creating the Data Set
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Managing Data Binding > Tutorial: Binding to a Corporate Database > Creating the Data Set

Glossary Item Box

Now that you have specified the database and the data to use from the database, you will create a data set to contain the data for your Spread control.

Using Code

  1. Select the dbAdapt OleDBDataAdapter control on the form.
  2. Press F4 to display the Properties window for the control, if it is not already displayed.
  3. Click the Generate Dataset verb at the bottom of the Properties window.
  4. The Generate Dataset dialog appears.
  5. Click OK to close the Generate Dataset dialog.

    The new data set control is added to your form.

  6. Press F4 to display the Properties window for the new DataSet control, if it is not already displayed.
  7. In the Properties window, change the name of the control to dbDataSet.
  8. Double-click on the form in your project to open the code window.
  9. Type the following code in the Form_Load event:

Example

C# Copy Code
DataSet ds;
 
ds = dbDataSet;
 
dbAdapt.Fill(ds);
 
Dim ds As DataSet
 
ds = dbDataSet
 
dbAdapt.Fill(ds)
 
VB Copy Code
Dim ds As DataSet
 
ds = dbDataSet
 
dbAdapt.Fill(ds)
 

This fills the data set with the data from the database you specified, using the fields you specified when setting up the OleDbDataAdapter control.

Return to the list of steps for Tutorial: Binding to a Corporate Database.

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.