Your data set is ready, now you need to add the Spread component to display the data, and provide code to bind the Spread component to the data set.
- Double-click on the form to open the code window.
- Type the following code below the code you added to create the data set:
C#
Copy Code FarPoint.Web.Spread.Model.DefaultSheetDataModel model = new FarPoint.Web.Spread.Model.DefaultSheetDataModel(dbDataSet); FpSpread1.Sheets[0].DataModel = model;
Visual Basic Copy Code Dim model As FarPoint.Web.Spread.Model.DefaultSheetDataModel = New FarPoint.Web.Spread.Model.DefaultSheetDataModel(dbDataSet) FpSpread1.Sheets(0).DataModel = model
- Save your project.
- Run your project and you should see a form that looks similar to the following:
- If your form does not look similar to this form, adjust the size of your Spread component, and re-check the steps you have performed so far.
- Stop the project
Return to the overview of the Tutorial: Binding to a Corporate Database tutorial.