Blog blurb

This blog is the resting place of my various projects. It's a place to find out about my various commercial and personal projects. Some of them are quite geeky and some of them are more arts based. All my projects are a small subset of all my ideas for projects. There's not enought time really.

RSS Get updates by subscribing to the RSS feed.

Richard's weather

sunny

Richard in Leeds is mainly experiencing sunny intervals.

Simple SQL Server Database Schema Printer (ASP.NET)

27/02/2008

Screenshot showing a table and its information

I created this simple app recently to print out all the tables in an SQL Server database. It shows each table's name, description and information about all its columns. I mainly use it when I start on a new project that has an existing database that I need to fully understand.

This is an ASP.NET app, but it's based on the code from Jim Rutherford's ASP SQL Server Schema Printer.

It's just an ASP.NET page. First you need to add your database connection string and then you upload it to your webserver.

You can download it from here:

RichardGComments: 0

Perfect validation?

17/09/2007

Doing validation well and being able to get it done quickly is a recurring problem in any web project. When I first started using ASP.NET I thought the built in validation controls would be the answer.

They were really easy to add to a page, but they didn't do everything I wanted them to and I found some of the code they produced a bit strange.

I set about making my own controls that would be just as easy to add to a page, but do everything I wanted them to.

My main requirements were:

  • Easy to reuse and add to new forms
  • Validate on server and client
  • Client side validation to use ajax
  • Visual feedback to user as form is being filled in
  • Easy to unit test

I've created a number of validation controls that are very easy to add to a page. You just add the controls, tell them the validation rules to use and everything else is done for you. It only takes a few minutes and this used to take hours.

The controls will always validate on the server, but if they will also validate with JavaScript (if available) and only submit to the server when the validation passes.

The visual feedback was difficult to get right and I had to test out several options on willing volunteers till I found what worked best.

I've centralised all the validation rules I use and written unit tests for them. This means that I'm much more confident that the validation validates what it is supposed to.

You can see them in action on my contact page and the register page of this blog.

However, I'm still not sure they're perfect and I'm going to keep on refining them. The great thing about creating controls to do this, is that they'll continue to get better, and all my projects past and present will benefit from it.

RichardGComments: 2

Richard's weather

22/06/2007

A photo of me in the rainThe weather in Leeds lately has been very random. Sunny one minute, torrential rain and thunder the next.

To help others know what weather I'm experiencing, I've made a handy ASP.NET control that displays the weather in Leeds. It shows a picture of me experiencing that weather and can also tell you the weather in several other places I've been to.

It can also change how the whole site looks based on the weather, but it doesn't do this at the moment. You can see this control on the right hand side of my blog's homepage.

RichardGComments: 2

Automating ASP.NET building with NAnt

13/06/2007

In my drive to sort out my development processes there are a few things I want to do. Top of my list is proper automated testing and creating automatic documentation.

Doing these steps every time I compile my site (or application) will add a lot more steps, so I thought it would be better to learn how to automate the build process first.

I'd heard that NAnt was the tool I should be using, but I found it a little bit overwhelming.

NAnt is a program that follows a list of instructions in an XML file called a build file. These instructions are used to do a series of tasks like the following:

  • Compile a site's ASP.NET code behind files
  • Compile some unit tests
  • Copy some files
  • Run the unit tests
  • Run a program to create documents

It took me a while to get my head round it, but I finally got a simple build file working. I found Jean-Paul Boodhoo's NAnt starter series very helpful.

Next I'm going to get the testing working and then automate it using NAnt.

RichardGComments: 2