For this article, it will teach you how to make Dropdown list, checkbox list, radiobutton list and listbox these four kinds of controls get data from database via one SQL query.
For example, you have five fields Name, Sql Dropdown, Sql Checkbox list, Sql Radiobutton list, Sql Listbox in your form.
And you want to read data from Users table of database, username as Item Text, UserID as Item Value.
1. Firstly, you need to enter Management Center -> Step Wizard page and then click “Add A New Step” to add one Step. Finally, please click “Add A New Filed” button.
2.In Title, please enter ”Sql Dropdown” and choose “Drop-down List” for “Control Type” option. Finally, please enter following sql sentence in “Value” option.
[SQL]select username,userid from users
Please note, you need to enter [SQL] Token in the head of Value Textbox. In this way, programming will execute sql query behind [SQL] Token. First field of Sql query represents Text in Dropdownlist, second field represents Value in Dropdownlist.
Configuration method of checkbox list, radiobutton list and listbox controls is the same with Dropdownlist.
3. After you finished configuration, you will see following interface in the front-end.
Below, you will find download link for xml configuration file of form. You can go to Management Center -> Copy Form page and import it. In this way, you will get this form instantly.