(byte)dr["Building"]
In this case you are asumming the dr collection holds byte but it's
return type is something other than byte (typically object), so you know
the collection contains bytes but the compiler doesn't. The case (byte)
is telling the compiler that you know what you are doing, i.e. that dr
really does contain bytes and you want to retrieve one.
> and this:
> Convert.ToByte(dr["Building"])
In this case you don't know that the dr collection contains bytes, it
may contain a string retpresentation of a byte, so for example the value
of dr["building"] would be "2" rather than 2. In that case you have to
convert from a string "2" to a byte 2.
Hope that makes sense
Kevin