Add a data source to a form
To display content on a page in the user interface, a data source must be added to a form in the form designer window of Visual Studio. You can select and drag a table or query from your project in the Solution Explorer window or drag a system table from the Application Explorer window. You can choose to use one table or many tables, depending on the number of fields that you will use for your form.
Follow these steps to add a data source from the Application Object Tree (AOT) to your form by using a select and drag process:
- Ensure that your form is open in the form designer window in Visual Studio.
- In the Application Explorer window, expand the AOT node. You can view the Application Explorer window by going to View > Application Explorer.
- Expand the Data Model node.
- Expand the Tables or Table Extensions node, depending on the type of data source that you are adding.
- Select and drag your desired table from the AOT node to the Data Sources node in the left pane of the form designer window.
Alternatively, you can add a data source to your form by using the Data Sources node in the form designer.
Follow these steps to add a data source from your project:
- Ensure that your form is open in the form designer window in Visual Studio.
- In the left pane of the designer, right-click the Data Sources node and select New Data Source.
- Select DataSource1 under the Data Sources node and go to the Properties window.
- Select your table in the Table property drop-down menu. You can also select any table from the AOT node in this menu.