SQL from an App Query
The easiest way to get SQL data is using Visual Query. Note that this only works, if your razor is inside 2sxc/eav. This example gets the list of files from DNN using a query like
Select Top 10 * from Files Where PortalId = [Params:SiteId]
Note that the parameter SiteId
is preset to be [Site:Id]
.
SQL from a App Query, setting Params
The easiest way to get SQL data is using Visual Query. Note that this only works, if your razor is inside 2sxc/eav. This example gets the list of files from DNN using a query like
Select Top 10 * from Files Where SiteId = [Params:SiteId]
Here we override the parameter SiteId=1
.
Run an App Query multiple times on the same page
The previous examples showed how to use a Query
. Now we want to run the query twice, which requires a Reset()
.
Note that the parameter SiteId
is preset to be [Site:Id]
.