Well, I'm not particularly familiar with DataReader's but a couple of things
come to mind to make your code "Better":
1. Is the query going to be the same all the time - can you gain an
efficiency perspective by either precomputing the ordinal value of the
field, or precomputing a "pointer/reference"" to the object (assuming the
reader does not recreate it each time)?
2. In the first line (IsDBNull) you go to the trouble of computing the
ordinal of the field (admittedly because IsDBNull only offers this variant),
then you just throw it away and look up the field by name in the second
line. You would gain better efficiency by just holding the ordinal as a
temporary value (eg. within the routine) and using it in both places. Given
that the sample DataReader implementations I have seen simply use a linear
search to compute an Ordinal, that's an awful lot of "lookups" happening
every time, so minimising it would be worthwhile. A dictionary lookup will
be more efficient, but still not as efficient as not doing it.
3. Since I come from a large systems background, the use of "magic
constants" such as hard-coding the "Customer" literal is pretty dodgy in my
opinion. These should be declared as constants somewhere. Having said that,
RAD-style development tools such as VS.NET that encourage you to plug in
"properties" all over the place against objects don't really encourage
constant-reuse so this will have to be something you make the call on. This
is something I'm grappling with at present.
Hope this helps.
Kevin