F
Fresh_Air_Rider
Hi Folks
I have a strongly typed dataset which works perfectly well until a NULL
value is returned for a DateTime field.
Whatever I try to do to test for a NULL value results in an Invalid
Cast Exception
I have tried Microsoft's suggestion of editing the XSD file as
follows:-
xmlns:codegen="urn:schemas-microsoft-com:xml-msprop"
nillable="true" msprop:nullValue="1980-01-01T00:00:00"
All of the following tests have resulted in an Invalid Cast Exception
_dsH.Headlines[0].DatePublished ==
System.DateTime.Parse("1980-01-01T00:00:00");
_dsH.Headlines[0].DatePublished == System.DBNull.Value;
_dsH.Headlines[0].DatePublished == SqlDateTime.Null.Value;
Could someone please give me a code snippet which tests a Typed DataSet
column of DateTime to see if it has a NULL value ?
Many thanks in advance
David Parry
I have a strongly typed dataset which works perfectly well until a NULL
value is returned for a DateTime field.
Whatever I try to do to test for a NULL value results in an Invalid
Cast Exception
I have tried Microsoft's suggestion of editing the XSD file as
follows:-
xmlns:codegen="urn:schemas-microsoft-com:xml-msprop"
nillable="true" msprop:nullValue="1980-01-01T00:00:00"
All of the following tests have resulted in an Invalid Cast Exception
_dsH.Headlines[0].DatePublished ==
System.DateTime.Parse("1980-01-01T00:00:00");
_dsH.Headlines[0].DatePublished == System.DBNull.Value;
_dsH.Headlines[0].DatePublished == SqlDateTime.Null.Value;
Could someone please give me a code snippet which tests a Typed DataSet
column of DateTime to see if it has a NULL value ?
Many thanks in advance
David Parry