Relational data in SharePoint with SLAM!

Often with the applications we build on sharepoint it would be much easier to analyse the data if we could do a straightforward SQL join between two lists, just as you would with two tables in SQL, but, alas, this is not catered for out of the box. I have managed to do it with a DVWP and data sources in SharePoint Designer but this was only really useful on simple and small amounts of data. So I was quite ecited by this project I have stumbled across on CodePlex yesterday - SLAM. It looks to take the list data in sharepoint and copy it out to SQL so that you can then run standard SQL queries against it. There seems to be some management built in as well, so very promising. I haven't had a chance to try it out yet, but will certainly give it a go next time we need to do some reporting on SharePoint list data.

Quote from their site:

Most developers who have used SharePoint as an application development framework have run into the realization that SharePoint is NOT a relational database. In fact, the accepted wisdom is if you need relational tables, use ASP.NET/SQL straight-up, not SharePoint.

Enter SharePoint List Association Manager (SLAM). In short it allows you to define relationships (one to one, one to many, many to many) between SharePoint lists (or Content Types) and then leverage those relationships in webparts or custom field types using familiar and straight forward SQL queries
.

Find it on Codeplex at http://www.codeplex.com/SLAM.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

The benefits of using code generation tools such as SubSonic

We have been evaluating a number of code generation tools recently & the one we like the best is a tool called SubSonic

Subsonic is an open source object-relational mapper for the Microsoft .NET Framework that can really speed up the development of any software project using a database for storage.

Within minutes of completion a database design Subsonic will generate all the code for your Data Access Layer (DAL) using the ActiveRecord pattern.  In addition methods to call all Stored Procedures are generated (with a single line of code). Read only objects are also created for all defined Views.  In addition, Ruby-on-Rails like Scaffolds are generated giving you an instant web interface to enter test data into your database.

Subsonic also includes some time saving web controls, the most useful of which are:

QuickTable  - a quick and easy way to instantly show data from a table in a read only, sortable, pageable (server paging for performance)  but lightweight control (no massive viewstate here).

DropDown – in instant dropdown from any database table, no additional code required.

An intuitive query model enhances productivity and reduce even quite complex queries down to a line or two of code:

Query("Products").WHERE("CategoryID = 5").AND("UnitPrice > 10").OR("CategoryID = 1").AND("UnitPrice > 10").ExecuteReader();

Changes to your database can easily be incorporated via a web or command line based generator or for smaller sites the automatic build provider gets the job done.

The included code generation templates can easily be customised (they are simple asp.net like syntax) to cover any more specialised needs.

Having used SubSonic on a recent project (which had extremely tight deadlines) we found it an invaluable resource - reducing not only our development time, but code complexity too.  We did find the odd buglet thrown in for good measure (which you may expect from a relatively new open source project) but these were quite easy to overcome & the time savings certainly outweighed these.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

Dilbert of the day