Converting Static Data into SQL Data

Description

Static List Control data can be converted to a SQL data source using the "Convert Data Source to SQL Database" tool.

 

  1. In the UX Builder on the UX Controls page, open the Data Controls menu and click on the [List] option to add a list control to the component.

  2. Highlight the added list control. In the control's properties list, in the List Properties section, click on the button next to the List properties property to open the List Builder.

  3. In the Data Source pane select 'Static' from the Data Source Type menu.

  4. Click the button next to the Static data property to open the 'Static Choices' dialog.

  5. Click on the 'Sample data'' button in the lower corner of the dialog.

  6. From the available sample data select the 'Name and addresses (big data set)' option and click OK and OK again.

  7. Back on the Data Source pane, go to the Return Value section and click the button next to the Return field property.

  8. Set the return field to one of the fields in the static data, in this case the ContactName field. Click OK

  9. In the "Convert Data Source to SQL Database" section click on the button next to the 'Convert List data source to SQL database' property.

  10. In the Convert Data Source Type genie click the button next to the Connection string property.

  11. If you already have a connection to the Northwind database, choose the 'Use a named connection string' radio button, click the Select button, and select the Northwind database connection. Otherwise check the 'Specify a connection string' option and define a connection to the Microsoft Northwind database. Close the Connection String Genie

  12. Still in the 'Convert Data Source Type' genie select 'New Table' from the dropdown options.

  13. In the New table name property give the table a name by typing it into the textbox. and click OK.

  14. Click the button next to the 'Map fields in the List to columns in the SQL table' property.

  15. View the Table Structure, then Click OK.

  16. On the Data Source pane the data should now appear as SQL in the Data Source Type menu.

  17. Open the List Layout pane in the List Builder. Use the blue > arrow to move some fields from the Available Fields list into the Columns in List. Click OK to close the List Builder

  18. Run the Component in the Live Preview.

    Static data converted to SQL data displayed in a list control

When you create a new component you should see the table you defined appear in the Northwind database alongside the other built-in tables. For an example of a good place to make use of this data see the afterRefreshListIncremental Event page.

See Also