This project is read-only.
Project Description
A collection of web development tools and frameworks for developing in ASP.NET MVC, ASP.NET classic, DotNetNuke, as well as a DotNetNuke MVC framework.

It does three things very well:
1. Does not translate your SQL, what you write is what's outputted
2. Handles all the parameterization for automatically as your build your statements. (no sql injection attacks etc.)
3. Fills your objects with the return data very simply.

SQLHelper.SELECT("ItemId, ItemDate, Description, Hours").
                              WHERE("PortalId", App.PortalID).
                              AND("UserId", App.UserID).
                              AND("ItemDate", ">", Today.AddDays(-28)).
                              ORDERBY("ItemDate DESC").
                 ExecuteCollection(Of TimesheetItem)()

SQL.INSERTINTO("{{timesheet}}", "PortalId, UserId, ItemDate, Description, Hours").
                       VALUES(App.PortalID, App.UserID, ItemDate, Desc, Hours).

SQL.DELETEFROM("{{timesheet}}").WHERE("ItemId", ItemId).ExecuteNonquery()

SQL.UPDATE("{{timesheet}}").SET("ItemDate", ItemDate).SET("Description", Desc).SET("Hours", Hours).WHERE("ItemId", ItemId).ExecuteNonquery()

Other Features:
2. Paged results
3. If you don't find a function to do your specialized sql statement... remember it is just a string builder for sql ... so just jump on the .ADD method and add your sql code as you wish.
4. Caches your object graph so it does not incur the expense of rediscovering your objects when hydrating them.
5. Compact code. It is not an ORM but rather a very productive SQL Builder
6. It does not make you coffee :)

Download it check it out, and if it does not do what you want... simply add a method to to it to handle your scenario... it is supper easy since it uses a jQuery style syntax, your method now becomes available to the builder syntax.

A few more samples and little C# love (SQL is just a convenience property that automatically creates a new SQLHelper class with appropriate ConnectionString for you and returns it):
SQL.SELECT("M.MediaId, Title, Author, Year, Category, Description")
      .FROM("MediaList M")
      .INNERJOIN("Favorites F").ON("F.MediaId=M.MediaId")
      .WHERE("F.UserID",userId).ORDERBY("Title, Year DESC")

SQL.SELECT("SettingValue").FROM("Settings").WHERE("SettingName", "MaxFileSize").ExecuteScalarString();

SQL.SELECT("C.CourseId, C.Author, C.Year, Number, Name, Description").
       FROM("Courses C").
                    .LIKE("ShortDescription", keyword).OR()
                    .LIKE("PrintDescription", keyword).OR()
                    .LIKE("Author", keyword)
                    .OR("Number", keyword)

SQL.SELECT("UserName, FullName").FROM("Users").ORDERBY("FullName").ExecuteCollection<UserListItem>();


Last edited Jun 18, 2010 at 10:33 PM by MitchL, version 1


No comments yet.