Hi,
I have coded a class which inherits from DataSets and
creates two datatables and a datarelation between them.
My intention is to drag it to a form in order to bind the
dataset to several controls.
When I drag the dataset to the form, the designer
automatically adds code in the InitializeComponent method
to create the relation between the tables and adds it to
the dataset.
Obviously, as the DataSet already contains the relation
when the app runs it crashes with the error that the new
relation is already created in the dataset.
Any idea of how can I avoid this behaviour of the winform
designer?
Thanks in advance.
Jose Antonio.
Jose Antonio - 05 May 2005 12:38 GMT
Checking the code of a typed DataSet I have found that in
the class that inherits form DataSet,
methods "ShouldSerializeTables"
and "ShouldSerializeRelations" must be overriden returning
false.
I have done this change in my code and it works perfectly.
Jose Antonio.
>-----Original Message-----
>Hi,
[quoted text clipped - 21 lines]
>Jose Antonio.
>.