October 2007 Blog Posts

A Better Pager for the ASP.NET 2.0 GridView

The default pager on the ASP.NET 2.0 GridView is not pretty, and is barely practical. I've tried styling it and mucking around with the RowDataBound and RowCreated events behind the scenes, and finally I thought I'd just have to learn to live with its limitations. This week I discovered some great pager code on CodeProject by Daniel Vaughan, and below I've shown the difference that the "Amazon-esque Pager" control made for me: Daniel even took the time to answer my questions on getting his C# code working with databound gridviews. Brilliant! If you're frustrated by the limits of the in-built Pager, give...

Book Review: Getting Real by 37signals

Over several weeks I've been reading 37signals' (makers of web apps Basecamp and Highrise) book Getting Real. The whole book can be read online at http://gettingreal.37signals.com/toc.php. The book describes 37signals' design and operating philosophy, based on their experience working in small teams to design software. The book is easy to read: there's no code, each chapter is divided into bite-size essays, the book is well-written and a lot of the advice really makes sense, especially if you have read anything about "agile" processes previously. 37signals has well-deserved credibility, as their apps are fairly successful and can be used as prime examples of...

Reporting Audit Changes to SQL Server 2005 objects

Following on from my last post on "Auditing Schema Changes to SQL Server 2005 objects", here's a simple bit of code that will take the EVENTDATA XML and transform it back into rows (note you need to have already run Richard's trigger and table creation script): --EventData XML is element-centric. Below is an example, as elements will vary--depending on what the "event" actually is:/* <EVENT_INSTANCE>  <EventType>ALTER_TABLE</EventType>  <PostTime>2007-10-02T15:39:42.707</PostTime>  <SPID>71</SPID>  <ServerName>SERVER</ServerName>  <LoginName>DOMAIN\USERNAME</LoginName>  <UserName>dbo</UserName>  <DatabaseName>TestDatabase</DatabaseName>  <SchemaName>dbo</SchemaName>  <ObjectName>tblTest</ObjectName>  <ObjectType>TABLE</ObjectType>  <TSQLCommand>    <SetOptions ANSI_NULLS="ON" ANSI_NULL_DEFAULT="ON" ANSI_PADDING="ON"      QUOTED_IDENTIFIER="ON" ENCRYPTED="FALSE" />      <CommandText>        ALTER TABLE dbo.tblTest DROP CONSTRAINT DF_tblTest_Test      </CommandText>  </TSQLCommand></EVENT_INSTANCE>*/--just get back the necessary elements from the audit...

Auditing Schema Changes to SQL Server 2005 objects

I recently needed to implement a lightweight, simple audit trail in SQL Server 2005. After googling and finding many, many ways, I settled on Richard's recent blog post over at GeekDojo titled "Super easy SQL Server 2005 Database Schema change auditing". Richard has posted a short, helpful script to audit data definition (CREATE, DROP, ALTER) SQL statements to a central table using a simple trigger and the XML data type. This means I can keep an audit trail of schema changes, along with all the information available (user name, date & time, SQL statement, etc.) I'm looking forward to working with this....

«October»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910