Toward Snowdon
23 June 2008 Personal
Picture of me
I recently found this old photograph  taken during my days at UCNW Bangor. It's me on a trek to Snowdon . I remember there were three of us Patrick, Eric and myself. We reached the summit of Snowdon and camped the night returning to Bangor the next day.
 
All I can remember that it was bloody cold and I was starving and that it rained most of the time.
Technorati
19 June 2008 Uncategorised
Technorati logo
I've just registered this site with Technorati. Apparently Technorati is one of the best traffic providers for bloggers. By joining Technorati my blog should be much easier to find when users search by Technorati tags.
 
Click on the link below to learn more.
 
Captcha Control
17 June 2008 Tips
Captcha Image
Recently the site has been having problems with the Captcha control. The use of the Captcha for say a contact form greatly eliminates spam by presenting the user with a challenge and response test, the idea being that only humans can pass the test.
 
Unfortunately my Captcha wasn't working too well. Despite the correct code being entered a message was displayed informing the user to try again. It appeared to be a postback problem, which was resolved  by removing some data access code  from the the Page_Load event in the code behind of the Master page and placing it in the Page_PreRender event in the code behind.
 
This seems to have done the trick, my Captcha control is finally working!
Browser Viewport
12 June 2008 Tips
Bubble Image
Someone recently pointed a problem with my site. It appeared that if the clients browser viewport was less than 880px then the horizontal scrollbar that appears doesn't allow the content on the far left of the site to be brought into view. This problem seemed only to effect IE.
 
The solution:
 
Change
 
           #wrapper{margin-left:-500px;}
 
To
 
           #wrapper{margin:0 auto;}
Aggregate Count Function
05 June 2008 Tips
Bubble Image
I needed to show a count of entries against months in my archive list. My database table uses the DateTime function for the date field. This lists entries against the day, month year and time, for example 04/05/2008 03:34:45.

My previous blog entry for March showed that using

SELECT DISTINCT DateName(Month,Date) AS theMonth,
DatePart(Year,Date) AS theYear,
Month(Date) AS theMonth
FROM myTable
ORDER BY DatePart(yyyy,Date) DESC,
month(Date) DESC

listed the months in chronological order, however  I found it extremely difficult to incorporate a count using a derivedTable and still maintain a logical order for the months.

After hours of effort and research the following solution was arrived at.

SELECT dateAdd(mm,DateDiff(mm,0,date),0) AS date,
COUNT(date) From myTable
GROUP BY DateAdd(mm,DateDiff(mm,0,date),0)
ORDER BY date DESC

To format the date and only show the month and year I used

<%#Eval(“date”,”{0:y}%> (<%#Eval(“Column1”)%>