All posts by Eric

I’m a PC

In honour of my new computer, some of the quality issues in recent computers and the Apple Get A Mac Ads I had an idea for a new TV script.

So here goes:

Scene opens with PC and Mac standing there beside each other.

PC: I’m a PC.

Mac: And I’m a Mac.

PC: Hey Mac, you’ve got something on your face.

PC indicates a spot on his face.
Mac rubs his face. A huge scratch stretches across his face.

PC: Umm, Mac, you just scratched your face.

Mac: No I didn’t.

PC: Yes, I think you did.

PC’s leg falls off, then explodes.

Mac rolls his eyes at camera.

Mac (smug): I don’t explode, or crash.

Mac’s leg explodes, but he doesn’t notice. Mac closes eyes and lies down on the ground.

PC: Wake up Mac!

Mac opens eyes and stands up.

Mac: I wasn’t sleeping.

Steve Jobs comes on

Steve Jobs (smugly, but that is how he always talks): Macs are the best computers. Much better than PCs.

Mac starts to glow a bright orangy colour

Steve Jobs (still smugly): Macs are the best computers. Much better than PCs.

Steve Jobs’ hair catches fire.

Steve Jobs (even more smugly): I’ll bet you wish your hair was on fire.

Aaaaand Scene. Okay, that was fun. I’m not a PC zealot and I would love to own a Mac (though I’m waiting for their quality issues to pass before paying the premium prices Apple charges). I ordered a new PC the other day, and I got some really good quality parts. Windows XP is very stable, and I haven’t had a virus in the last 8 years or so. So I don’t know what the fuss is about.

I think Apple is spreading a lot of FUD with their ads, while at the same time taking a long time owning up to the problems that arise in their own hardware.

While Dell doesn’t make really awesome hardware, they at least own up to the issues in their hardware fairly quickly.

ASP.NET CheckBoxList DataBinding with Checked

So today I ran into an interesting issue with DataBinding to a CheckBoxList in ASP.NET 2.0; you cannot bind the checked state to the checked boxes. You can bind the Value and Text, but not the Checked state.

This leaves you with a few options for setting the checked state after databinding:

  1. Manually build the ListItem Collection for the CheckBoxList, setting the Value, Text and Selected values instead of databinding.
  2. Loop through the Items collection after databinding checking for each item.
  3. There is no number 3.

I decided to manually build a ListItem collection as follows:

foreach (DataRow dataRow in dataTable) {
string text =
string value = Convert.ToString(dataRow[COLUMN_VALUE]);
bool selected = Convert.ToBoolean(dataRow[COLUMN_SELECTED]);
ListItem newListItem = new ListItem();
newListItem.Text = text;
newListItem.Value = value;
newListItem.Selected = selected;

My New Blog

Hello everyone, this is my new weblog for my company’s site, The blog is humourously named Eric Will Code For Coffee! Yes, I laugh at my own cheesy jokes. 🙂

Coming soon I’ll write some posts about coding in ASP.NET, C#, and PHP as well as designing for ASP.NET with CSS – my favourite subject!