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

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