Skip to main content
Home  › ... Razor

Data Tutorials

Tutorial HomeData

Working with Data

If you want to work with data (like from a database) instead of content (which are data items assigned to one instance) you need to get it from somewhere and then loop through it. Typical data comes from:

  • the current App, using App.Data[...]
  • a query in the App, using App.Query[...]
  • a SQL database - either through an App.Query, from a DataSource or from a SqlReader
  • a CSV file - either through an App.Query, from a DataSource or from your own code
  • DNN objects like the users - either through an App.Query, from a DataSource, from DNN-objects or from your own code
  • a JSON or XML file - usually loaded from your own code
  • a WebService - usually loaded from your own code

Once you have the data, you will usually want to loop-and-show, which is easiest using dynamic objects, so you can just type things like @Content.FirstName to show the properties.