EDIT 2
I am updating the question again to more simply explain what I need.
I need to take any EntityObject in my application, convert it to XML, which can be reconverted back to AN object later that can be queried or used in a DataSource. I cannot reconvert to the original EntityObject because the structure of that object may have changed. Is this doable?
Original Question below
Let’s assume for a second that I am required by someone higher up than me (because I am) to take an EntityObject and convert it to a DataTable. The example I was sent on how to do it is from 2006 and uses a custom class (which my boss thought was built into .Net) and it doesn’t work anyway.
Is there a way to do this without writing my own custom class? Something as simple as “new DataTable(myEntityObject)” would be amazing. I’m guessing no though.
EDIT
I have changed the question because I was given the criteria wrong. Mainly we want our EntityObject to be XML so it can be stored in a database and reconstructed later. Can that be done via Serialization?
To answer your updated question:
Use the
XmlSerializer