Skip to main content

Posts

Entity Framework Code-First Learning Resources

Some resources to help learn and understand Microsoft's Entity Framework Code-First ORM. Basic Tutorial http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs Advanced Tutorial http://www.asp.net/mvc/tutorials/mvc-music-store-part-1 Blog posts with further hints and tips http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx Update to NerdDinner using EF Code-First. Also shows how to synchronise database with the model and seeding database with initial data. http://www.hanselman.com/blog/SimpleCodeFirstWithEntityFramework4MagicUnicornFeatureCTP4.aspx Some useful info demonstrating Data Annotations such as [Key] and [Required]. This post will be added to as time goes by. If there are any other good resources about this MS framework feel free to throw them in to a comment. Updates EF Feature CTP5: Code First Walkthrough http://blogs.msdn.com/b/adonet/archive/2010/12/06/ef-feature-ctp5-code-first-walkthrou...

Mounting and Reading ISO Files

An ISO image (International Organization for Standardization) is an archive file (also known as a disc image) of an optical disc, composed of the data contents of every written sector of an optical disc, including the optical disc file system. From  http://en.wikipedia.org/wiki/ISO_image  08/03/2011 Basically an ISO image, in layman's terms, is the file on a CD-ROM or DVD. ISO images can be downloaded and saved onto a CD or DVD and run as usual. Alternatively they can be virtually mounted without the need to burn the image to disc. Some Linux systems have this capability built in. For Windows, you can download some freebie software (or pay for it). A couple of free options are: DAEMON Tools Lite -  http://www.daemon-tools.cc/eng/products/dtLite SlySoft Virtual Clone Drive -  http://www.slysoft.com/en/virtual-clonedrive.html Once this software is downloaded and installed, the ISO image can be selected and "mounted" virtually, which will run the im...

.NET Content Management Systems

This is really just a reference of .NET Content Management Systems (CMS) to work through and evaluate for various projects. Of course client requirements need to be factored in, such as ease of use for the client as ultimately they will be the end user, along with development, customisation, both skinning and dev-wise, and how well supported the system is and the size of the community around it. There are loads out there but until a CMS reaches a certain critical mass, it's always a little bit uneasy using a less well tried and tested one for commercial and production purposes, or one that does not have a large user and dev community behind it. If you know anymore or want to mention one, feel free to add a comment. Ta very much. DotNetNuke -  http://www.dotnetnuke.com/ Umbraco -  http://umbraco.org/ Kentico -  http://www.kentico.com mojoPortal -  http://www.mojoportal.com/ Orchard Project -  http://www.orchardproject.net/ Non ASP.NET CMS Joomla ...

Weebly - Online Content Management System

A recent project needed to get on-line quickly, easily, cheaply and with minimal effort. The site had to be able to be administered easily by non-tech types and also contain a few features such as a blog, contact forms, the ability to include custom HTML for Twitter feeds, PayPal, sharing links, etc., etc. http://www.weebly.com A number of options would fit these parameters, and obviously a content management system of some sort would be ideal. Installing, configuring, finding and paying for a host can be troublesome at times, which led me to Weebly - an on-line Content Management System with free hosting, no set up fees or issues, feature rich and easy user interface. You can pay for a pro version which gives the usual obvious benefits of own domain (instead of subdomain of Weebly), better stats (but you can just plug in your own Google Analytics code), a couple more features to include on your website, removal of the Weebly link in the footer .... anyway, ...

API Arrived for Goo.gl, Google's URL Shortener

After some waiting around since goo.gl went live and became available to the general public in September 2010, the API has finally been released this week. Documentation can be found at http://code.google.com/apis/urlshortener/overview.html and a "Getting Started" guide can be found at http://code.google.com/apis/urlshortener/v1/getting_started.html There has been eager anticipation waiting for the release of the API and this should be pretty cool for allowing developers to use Google's URL Shortener in their own applications and projects. Thanks to Google and the URL Shortener Team for releasing this. Blog post announcing release:  http://googlecode.blogspot.com/2011/01/google-url-shortener-gets-api.html

SQL Server - Function to Convert String to Proper Case

Below is just a quick and simple function to convert a short string to proper case. It's not the most efficient but will do its job for short strings. The first character of the string is converted to upper case, subsequent characters that are preceded by a space are converted to upper case. e.g. "this IS A TEST sentence. followed BY ANOTHER." will be changed to "This Is A Test Sentence. Followed By Another." Function: CREATE FUNCTION [dbo].[fncProperCase](@string VarChar(1000)) RETURNS VarChar(1000) AS BEGIN DECLARE @pos int DECLARE @len int DECLARE @char VarChar(1) DECLARE @temp VarChar(1000) SET @string = LOWER(LTRIM(RTRIM(@string))) SET @temp = '' SET @pos = 1 SET @len = LEN(@string) WHILE @pos <= @len BEGIN SET @char = SUBSTRING(@string, @pos, 1) IF @pos = 1 BEGIN SET @temp = @temp + UPPER(@char) END ELSE BEGIN IF SUBSTRING(@string, @pos - 1, 1) = ' ' BEGIN SET ...

SQL Server - Remove Non-Alphanumeric Characters from String

The following SQL function will remove and strip all non-alphanumeric characters from a string. CREATE FUNCTION [dbo].[fncRemoveNonAlphanumericChars](@Temp VarChar(1000)) RETURNS VarChar(1000) AS BEGIN WHILE PatIndex('%[^A-Za-z0-9]%', @Temp) > 0 SET @Temp = Stuff(@Temp, PatIndex('%[^A-Za-z0-9]%', @Temp), 1, '') RETURN @TEmp END Example: SELECT dbo.fncRemoveNonAlphanumericChars('abc...DEF,,,GHI(((123)))456jklmn') Result: abcDEFGHI123456jklmn