C
cpnet
I have a DataTable defined in a strongly-typed DataSet:
[Serializable()]
public class MyDataSet: DataSet...
{
...
public class MyDataTable: DataTable...
{ ...}
...
}
I have a class that references MyDataTable:
[Serializable()]
public class MyClass
{
private MyDataTable myDataTable;
}
When I try to serialize (binary serialization) MyClass, it tells me I can't
because MyDataTable is not serializable. I had thought that as a child
class of MyDataSet, that MyDataTable would be serializable, but I guess not.
I built my dataset and datatable with the built in dataset designer, which
auto-generates the .cs code. Is there anyway to assign the [Serializable]
attribute to MyDataTable, without manually editing the .cs file for the
dataset? (I don't want to do this because as soon as I use the designer
again, I'll lose my manual changes). MyClass does need to be able to
serialize myDataTable, so I can't just mark it as [NonSerialized()].
Thanks
[Serializable()]
public class MyDataSet: DataSet...
{
...
public class MyDataTable: DataTable...
{ ...}
...
}
I have a class that references MyDataTable:
[Serializable()]
public class MyClass
{
private MyDataTable myDataTable;
}
When I try to serialize (binary serialization) MyClass, it tells me I can't
because MyDataTable is not serializable. I had thought that as a child
class of MyDataSet, that MyDataTable would be serializable, but I guess not.
I built my dataset and datatable with the built in dataset designer, which
auto-generates the .cs code. Is there anyway to assign the [Serializable]
attribute to MyDataTable, without manually editing the .cs file for the
dataset? (I don't want to do this because as soon as I use the designer
again, I'll lose my manual changes). MyClass does need to be able to
serialize myDataTable, so I can't just mark it as [NonSerialized()].
Thanks