Wednesday, June 29, 2011

NuGet, SQL CE 4 and CDN - oh my!

1 comment:

NuGet: http://nuget.org/

This is a system for “installing” components into your web application quickly and easily. So lets say your doing a data driven website using SQL CE 4, you’re going to be using jQuery and CSS control adapters. Simply create your new website as per normal fire up NuGet, do a search for jQuery and hit install, do a search for CSSFriendly double click and install. At this point it will have put copies of jQuery and CSS Friendly control adapters straight into your project! Brilliant! Theres LOADS of stuff available ousing NuGet these are only two VERY small example – check it out!

SQL CE 4: http://weblogs.asp.net/scottgu/archive/2011/01/11/vs-2010-sp1-and-sql-ce.aspx

This is an “in site” file based database and needs no server components to run just some webspace supporting .NET 4 – it replaces using MS Access SQLite or PostgresSQL. In order to use it you simply need Visual Studio 2010 sp1 and the SQL CE 4 tooling support installed which can be downloaded from here http://www.microsoft.com/download/en/details.aspx?id=23691 and here http://go.microsoft.com/fwlink/?LinkId=212219 . Then when you right click App_Data select New Item a new option will appear call SQL Server CE 4 – double click it and it will create for you a new database which you can use as per you would access.

SQL CE 4 Membership Provider: http://www.hanselman.com/blog/IntroducingSystemWebProvidersASPNETUniversalProvidersForSessionMembershipRolesAndUserProfileOnSQLCompactAndSQLAzure.aspx

Righty this little gem (provided via NuGet) is a way to use the Membership provider system built into .NET with SQL CE 4 – this is actually really easy to implement in about three step and takes about 5 minutes (I know because I did it yesterday). Once the steps are completed you will be able to use all the Membership functions directly from your new SQL CE 4 database saving you the time and effort of implementing this on small websites each time.

Google and Microsoft CDN

If you’re wanting to include framework such as jQuery jQuery UI and jQuery Validate then consider using a CDN (Content Delivery Network) version. This is basically an include to a file or files stored in the cloud. The advantages are tht you do not have to keep local copies of the files in your project and also that when a request is made when the page loads the file will be delivered from the nearest server to your user which should in theory speed up download times. The google CDN and Microsoft CDNS can be used in tandem so you could include jQuery and jQuery UI files from Google and Validate from Microsoft (I've done this and it works fine) – it’s a good way to keep your file footprint down on small sites:

http://code.google.com/apis/libraries/devguide.html#jquery (Shows links to .js files) for the CSS to be included from CDN also please read the following http://blog.jqueryui.com/2009/03/jquery-ui-17/ (Both CSS and Javascript files are hosted on the Google CDN but only the js files are listed – bit silly however the previous link shows how to include the CSS files as well!)

Microsofts version can be foud here: http://www.asp.net/ajaxlibrary/cdn.ashx (Webpage currently not working!)

Read More