I have a DataSet with multiple tables the source document is an XML file.
mydataset.ReadXML(filename);
There are multiple tables with multiple relations. I have the database in the SQL created via code - tables, columns and relations.
Now I would like to insert the data . (Yes I want everything). EDIT: The SQL tables use Identity Columns autogenerate - because I am not sure the incoming data will never duplicate one of the parameters that I would like to assume is unique.
So what methods should I do to ensure data is input considering I have foreign key constraints , how should I iterate the the tables in the dataset to make sure I don't try to insert in tables requiring an existing id. Do I create a hard coded map (I prefer not too) , or do I walk the tables looking for a Foreign key and verify the parent table etc..
Any Ideas ? I am sure someone has done this before and has a simple answer for me.