Spread Windows Forms 10.0 Product Documentation
Step 2: Setting up the Database Connection

You must tell the project which database you want to use. In this step, you will add a OleDbConnection control to your form, and tell it the name of the database to use.

  1. If the Toolbox is not displayed, from the View menu choose Toolbox.
  2. Click the Data tab to display the available data controls.
  3. Double-click the OleDbConnection control to add it to your form.

    The OleDbConnection control is added to your form, in a new area created below the visible area of the form. The data controls you create in this tutorial will all be placed in this area, instead of in the visible area of the form.

  4. Press F4 to display the Properties window for the OleDbConnection control.
  5. In the Properties window, change the name of the control to dbConnect.
  6. In the Properties window, click the ConnectionString property.
  7. Click the down arrow displayed on the right side of the setting area, then select New Connection from the drop-down list.

    The Data Link Properties dialog is displayed.

  8. Click the Provider tab, and then select Microsoft Jet 4.0 OLE DB Provider from the list.
  9. Click Next.
  10. Next to the Select or enter a database name box, click the Browse button.
  11. Browse to C:\Program Files (x86)\GrapeCity\Spread Studio 9\Docs\Windows Forms\TutorialFiles\databind.mdb and then choose Open.
  12. Click the Test Connection button.
  13. If you do not receive a message stating the "Test connection succeeded" retry steps 6 through 12.
  14. If you received the message "Test connection succeeded," your connection is complete. Click OK to close the Data Link Properties dialog.

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options | Documentation Feedback