We recently received a question via email that relates to working with data in a database.
The user was able to create a SQL connection in Stadium, but he wanted to know how to combine that with a form input field to search for a specific record from a database table. (In his words: “after i put input id of article in TextBox to make a search with my query and show a name of article in a Label [control on a page]?”)
Do the following:
(Prerequisite: you have created a SQL connection to your database.)
- Create a query under your SQL connection by right-clicking on the connection in the Application Explorer and choosing New Query
- Create query parameters using the SQL syntax in the query normally used to indicate a parameter, i.e. @parametername.
- Add a button to your page and use the Click event to run this query.
- Drag the query from the Application Explorer into the click script and set the parameter to the query.
- Then use a SetValue action to set the label to the name of the article.
Also see: