Hi all,
I have the following code:
this.Address = (string) dataReader["Address"];
which creates an invalid cast exception if it returns null, whats the best way to handle this? I don't really want to have if (dataReader["Address"] != DbNull.Value) for every db extraction..there must be a better way?
Thanks,
Matt.
I have the following code:
this.Address = (string) dataReader["Address"];
which creates an invalid cast exception if it returns null, whats the best way to handle this? I don't really want to have if (dataReader["Address"] != DbNull.Value) for every db extraction..there must be a better way?
Thanks,
Matt.