J
JezB
I'm using a typed dataset to get rows from a database, but getting an
invalid cast exception when trying to examine columns in that row which are
null in the database. This is because of some code generated within the
typed dataset's class (eg. myDataSet.cs) :-
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is
DBNull.", e);
}
I know I can force a change of this code by setting a NullValue property of
the specific elements within my dataset. However, when I expose the dataset
schema through a web service (it's exposed by having an exposed method
return a dataset of this type), this change seems to be ignored. It seems to
regenerate the default code in a class file called Reference.cs - and I must
admit I'm not quite sure what's going on here.
Could anyone explain this ? and what can I do to resolve this issue ?
invalid cast exception when trying to examine columns in that row which are
null in the database. This is because of some code generated within the
typed dataset's class (eg. myDataSet.cs) :-
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is
DBNull.", e);
}
I know I can force a change of this code by setting a NullValue property of
the specific elements within my dataset. However, when I expose the dataset
schema through a web service (it's exposed by having an exposed method
return a dataset of this type), this change seems to be ignored. It seems to
regenerate the default code in a class file called Reference.cs - and I must
admit I'm not quite sure what's going on here.
Could anyone explain this ? and what can I do to resolve this issue ?