Monday, 9 March 2009

Quite often it is not very clear on how to install your new skin in Dotnetnuke. DNN needs you to login with the host account. Then in DNN 4.9 click 'skins' on the host menu and then 'upload skin' from the dropdown menu next to the skin header. You need to point the 'browse' button to the zip file that contains your skin. This is often inside a number of zip files if you have purchased the skin from a vendor, so you will have to extract them first.

Monday, 2 March 2009

SQL Inline statements

Thought I'd post a quicky on SQL inline statements. Before I would create a variable and then assign a value depending on a CASE statement. But after a brief try I solved a problem with dates using an inline case statement. Converting the minute datepart to a string means that 5 past the hour becomes just 5 and doesn't look write in date strings. So i wanted any single numbers to be prefixed with zero. Here it is:

CONVERT(nVARCHAR,CreatedDate,103) + ' @ ' + CONVERT(nVARCHAR,DATEPART(Hh, CreatedDate)) + ':' + CASE WHEN LEN(CONVERT(nVARCHAR,DATEPART(Mi, CreatedDate))) = 1 THEN '0' + CONVERT(nVARCHAR,DATEPART(Mi, CreatedDate)) ELSE CONVERT(nVARCHAR,DATEPART(Mi, CreatedDate)) END AS CreatedDate