Skip to main content

Posts

Showing posts from April, 2007

If it can go wrong, it will!

If you've been reading my blog, you know that I am developing an application using Visual Studio 2005 and Castle's ActiveRecord framework. Recently, I bought Visual Studio 2005 Pro so I could use Crystal Reports. Believe it or not, The user was able to install my application without a working version of .Net 2.0 around. As far as I can tell, they did a Windows Update, and somehow it corrupted their video drivers. Then they did a system restore back to before .Net 2.0 was installed. After this, they installed my application, and it crashed (of course!). They tried to repair .Net 2.o Framework, but that didn't quite do it. So now I will probably be connecting via Remote Desktop to survey the damages. I learned something from this, and I will probably have two tiny executables in my bin folder ... a "hello world" application that maybe says "If you can see this, then .Net 2.0 is installed." and maybe does some sniffing around to see if an important

I won 2 fandango tickets

I know this entry is off-topic, but yesterday was pretty amazing. A co-worker told me about , and I signed up last month. Blingo is a search engine that uses Google's database for results, but as you search, you have a chance to win something. Blingo has "Thousand Dollar Thursdays" and sometimes they even give away an automobile! So yesterday I was trying to figure out why my ABit A8N SLI Fatality motherboard was crashing Windows XP since I added a SATA hard drive and a DVD burner. While I was searching, I won a Fandango movie ticket! That was cool, but I kept searching, and found that I needed to turn off the "[x] Let BIOS decide" option, and then turn off Command Queuing. So 30 minutes later, I did a different search and won again! That is 2 wins in a row! On the side panel, it lists who won what, and it showed me twice. The co-worker who referred me was ecstatic, as he has never won anything on Blingo so far. I use Firefox, and I like a clean

Defensive Programming with ActiveRecords

[Update 1: finished the entry, and added some compilable code.] [Update 2: Updated the compilable code - improved the Property setter code.] Recently, I have been working on a project with Castle's ActiveRecord support. Since I am changing my database schema as I discover new requirements, and adapt to new data sources, I occasionally run into query / model / table mismatches. Now, gross mismatches cause NHibernate to choke, and refuse to accept my models, but if I have merely added a field, that will be ignored until insert time. Even then, it might not cause an exception if it is a nullable field. Now when I first started on this project, I wrote a simple SQL procedure that selected a list of fields from the database schema, walked through a cursor for each field and PRINTed code, then I would create a class file in Visual Studio 2005 and paste that code in. -- Get a list of tables SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME != 'sysdiagrams