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.
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.
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.
In the Data Source pane select 'Static' from the Data Source Type menu.
Click the button next to the Static data property to open the 'Static Choices' dialog.
Click on the 'Sample data'' button in the lower corner of the dialog.
From the available sample data select the 'Name and addresses (big data set)' option and click OK and OK again.
Back on the Data Source pane, go to the Return Value section and click the button next to the Return field property.
Set the return field to one of the fields in the static data, in this case the ContactName field. Click OK
In the "Convert Data Source to SQL Database" section click on the button next to the 'Convert List data source to SQL database' property.
In the Convert Data Source Type genie click the button next to the Connection string property.
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
Still in the 'Convert Data Source Type' genie select 'New Table' from the dropdown options.
In the New table name property give the table a name by typing it into the textbox. and click OK.
Click the button next to the 'Map fields in the List to columns in the SQL table' property.
View the Table Structure, then Click OK.
On the Data Source pane the data should now appear as SQL in the Data Source Type menu.
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
Run the Component in the Live Preview.
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