Fork me on GitHub
DNN Apps - Demo-Zone
Discover DNN-Apps - simple and elegant, easy to customize
You are here: Home  >  Apps  >  SQL Data - Examples
Error Showing Content - please login as admin for details.

Simple Demo with PetaPoco Data access

This demo uses PetaPoco as a mini-ORM to get the data. More info on PetaPoco here.

The top 10 files found in this portal as returned by PetaPoco

  1. Hydrangeas.jpg (613)
  2. Koala.jpg (614)
  3. Penguins.jpg (615)
  4. Google Tag Manager Source Code Demo 2014-03-13.png (616)
  5. Beni.jpg (620)
  6. Daniel.jpg (621)
  7. Raphael.jpg (622)
  8. Chrysanthemum.jpg (659)
  9. Lighthouse.jpg (660)
  10. CokeBefore.jpg (663)

Pros

  1. Typed data
  2. Entity-Framework-like feeling without needing pre-compile
  3. Less code than the other direct data methods (SQL & DataTable)
  4. Short, brief syntax
  5. Would already support paging and other features (read the PetaPoco docs)

Cons

  1. Requires you to write classes for each type you need
  2. Lots of boilerplate / plumbing code for typed classes
  3. Numbered Parameters @0 instead of @PortalId
  4. Default mode with Query is forward-only like using a SQLReader
  5. Can't use 2sxc pipelines
  6. Can't use 2sxc-built-in serializers and other features

Simple Demo using DataReader access

This demo accesses the data directly, uses a SQL parameter for the PortalId then shows the first 10 files it finds. More intro-material for direct database access in this article on codeplex.

The top 10 files found in this portal

  1. Default.page.template
  2. Hydrangeas.jpg
  3. Koala.jpg
  4. Penguins.jpg
  5. Preview for Manage Content not Data.jpg
  6. Google Tag Manager Source Code Demo 2014-03-13.png
  7. Beni.jpg
  8. Daniel.jpg
  9. Raphael.jpg
  10. Chrysanthemum.jpg

Pros

  1. Easy - copy paste etc.
  2. Standard .net, no learning curve
  3. Probably best performance of all shown samples because almost no abstractions

Cons

  1. Only forward looping through the reader
  2. Code feels technical and maybe difficult
  3. Can't use 2sxc pipelines
  4. Can't use 2sxc-built-in serializers and other features

Simple Demo with DataTable access

This demo accesses the data by filling it into a DataTable.

The top 10 files found in this portal with reverse sorting

  1. Raphael.jpg
  2. Preview for Manage Content not Data.jpg
  3. Penguins.jpg
  4. Koala.jpg
  5. Hydrangeas.jpg
  6. Google Tag Manager Source Code Demo 2014-03-13.png
  7. Default.page.template
  8. Daniel.jpg
  9. Chrysanthemum.jpg
  10. Beni.jpg

The top 10 files found in this portal as returned from DB

  1. Default.page.template
  2. Hydrangeas.jpg
  3. Koala.jpg
  4. Penguins.jpg
  5. Preview for Manage Content not Data.jpg
  6. Google Tag Manager Source Code Demo 2014-03-13.png
  7. Beni.jpg
  8. Daniel.jpg
  9. Raphael.jpg
  10. Chrysanthemum.jpg

Pros

  1. Standard .net, no learning curve
  2. Allows further data manipulation in memory
  3. You can use the data a few times (reader is forward-only)
  4. Connection handling open/close is done automatically by the Adapter

Cons

  1. Code feels technical and maybe difficult
  2. no nice Object.Property-syntax
  3. Can't use 2sxc pipelines
  4. Can't use 2sxc-built-in serializers and other features
Error Showing Content - please login as admin for details.
Error Showing Content - please login as admin for details.
2serve . 2invent . 2create is 2be.