Spread for ASP.NET 7.0 Product Documentation
Using Spread with the AccessDataSource Control
Support Options
Spread for ASP.NET 7.0 Product Documentation > Developer's Guide > Managing Data Binding > Tutorial: Binding to a Corporate Database > Using Spread with the AccessDataSource Control

Glossary Item Box

Later versions of Visual Studio have data source controls that require fewer steps. This list of steps uses the AccessDataSource control to bind the Spread control.

  1. Start a new Visual Studio .NET project.
  2. Name the project databind.
  3. Name the form in the project binding.aspx.
  4. Add the FpSpread component to your project.
  5. Place the component on the form.
  6. If the Toolbox is not displayed, choose Toolbox from the View menu.
  7. Double-click the AccessDataSource control (under the Data section in the toolbox) to place it on the form.
  8. Select Configure Data Source in the pop-up menu and browse to the data file (mdb file). You may need to add the mdb file to the project to see it in the browse dialog.
  9. Click Next.
  10. Select Specify columns from a table or view.
  11. Select Products under the Name: drop-down.
  12. Select ProductName, ProductDescription, UnitPrice, and LeadTime in the Columns: section.
  13. Select Next and Finish. The Test Query button can be used to test the connection before selecting Finish.
  14. Bind the data source to Spread by adding the following code to the form:
    C# Copy Code
    FpSpread1.Sheets[0].DataSource = AccessDataSource1;
    
    Visual Basic Copy Code
    FpSpread1.Sheets(0).DataSource = AccessDataSource1
    
  15. Run the project to see the results.

If you do not know how to add the FpSpread component to the project, complete the steps in Adding Spread to a Project

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