Using the same table in multiple typed datasets (OO problem) RRS feed

  • Question



    I have a table, Address.

    This table is placed in multiple typed datasets (xsd) for example CompanyDataSet, PersonDataSet.

    So i have a CompanyDataSet.AddressDataTable class and a PersonDataSet.AddressDataTable class.

    These classes are the same, but part of other classes ( the dataset)


    I would like to create a usercontrol to edit an address, without knowing it's dataset type.


    What's the best way to do this?

    How can i 'convert' a CompanyDataSet.AddressDataTable and a PersonDataSet.AddressDataTable

    to a 'generic' AddressDataTable and AddressRow?





    Tuesday, November 20, 2007 3:47 PM

All replies

  • Hi,

    I think the simplest way to do this is to use the weakly typed DataRow directly.  Another option is to create an interface IAddressRow with all the necessary properties and to extend the partial classes of the 2 addresses to implement that interface.

    Hope this helps,
    Sunday, December 2, 2007 7:29 PM