P
PeterWellington
I have a column in a data table that stores enum values and assigns a default
value:
Dim dc As New DataColumn("TestEnumField", GetType(DayOfWeek))
dc.DefaultValue = DayOfWeek.Thursday
When I try to serialize/deserialize dataset schema, I get the error below
during deserialization:
"System.ArgumentException: The DefaultValue for column TestEnumField is of
type System.DBNull, but the column is of type System.DayOfWeek."
I've tried reading/writing the XML using the dataset's built-in methods as
well as using the SOAP formatter, both with the same results.
When I look at the XML file that gets created during serialization, I can see
that the default value for the column is there. In the above case, it is
stored as an integer, 4. So, it's not DBNull but maybe there's some problem
during the deserialization process converting 4 into DayOfWeek type?
Is this a bug or am I doing something wrong?
Thanks.
value:
Dim dc As New DataColumn("TestEnumField", GetType(DayOfWeek))
dc.DefaultValue = DayOfWeek.Thursday
When I try to serialize/deserialize dataset schema, I get the error below
during deserialization:
"System.ArgumentException: The DefaultValue for column TestEnumField is of
type System.DBNull, but the column is of type System.DayOfWeek."
I've tried reading/writing the XML using the dataset's built-in methods as
well as using the SOAP formatter, both with the same results.
When I look at the XML file that gets created during serialization, I can see
that the default value for the column is there. In the above case, it is
stored as an integer, 4. So, it's not DBNull but maybe there's some problem
during the deserialization process converting 4 into DayOfWeek type?
Is this a bug or am I doing something wrong?
Thanks.