Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Tuesday, June 16, 2015

Always catch exceptions!

I never usually bother to try and catch exceptions when writing experimental code because I expect the runtime to throw up a default exception dialogue.

But after much fruitless fiddling with a toy application using SqlDataAdapter, I found that instead of one of those dialogues, you can just have an infinite hang instead.

I was doing SqlAdapter.Fill(dataset) without first setting dataset to new DataSet(), which (when I eventually put a try-catch round it) I discovered was causing a System.ArgumentNullException - 'Value cannot be null'.

A lesson I shan't forget, because it's wasted about 4 hours today.

Followers

Blog Archive