Thursday 17 January 2008

.NET Framework source code available!

Granted, this has little to do with developing the website (something that I've been slacking in for a bit now), but it's just damn cool.

Scott Guthrie posted a note yesterday that the source code of the .NET Framework Libraries is available now. This means you can actually debug the Microsoft .NET classes!

In the comments he also mentions that a downloadable version will be made available as well, which ensures you don't have to be online to see the source.

Very cool. Read more on Scott's blog here.


Read more!

Monday 14 January 2008

[w] - Waiting for

How often doesn't it happen that you find yourself digging through your mail in order to see if there's anything you initiated, but for which you are dependant on others?

If you're chaotic like me, that happens quite a lot. Often I'll have tried setting things in motion, only to find out later that nothing happened so far. Usually this means I'll have to waste quite a bit of time digging through my mail in order to see when I sent the mail, to who, and whether anything happened.

This morning I came across an easy tip that will possibly save me all that time. In short, you create a new Outlook folder, and a rule that checks your outgoing mails. Should your mail contain a [w] tag, it will automatically be moved to your newly created folder, and you'll have a very easy way to have all items that require interaction from others listed together in a single spot.

Find out more on http://waiting-for.com/.


Read more!

Friday 4 January 2008

SQL Server 2005 varchar(max) in C#

An interesting question at work today: How to properly define a parameter that's varchar(max) in Sql Server 2005 from within C#?

Sure, it should be possible to use the signature without adding the integer value. But what if a custom DataAdapter is being used that does require a value if you supply a string? We could use 4000 as a value, but that kind of defeats the purpose of using the new datatype. 8000 then? Same difference; you still possibly end up with truncated strings. Should we make it 2bn? That's 2GB of memory. Not really an otpion in my book.

After some googling, we found the answer: the size of the parameter should be set to -1. There's an example here, where the -1 value is not explained in detail, but just shown in the code. We tested, and it works like a charm.


Read more!