Fastest way to read xml files and easiest code/setup to maintain when saving xml to tables on disk w

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
What is the fastest performance in reading xml files and easiest way to maintain project code and setup when reading in XML files and saving to tables on disk when there will be 50 unique field names initially and eventually up to 9,000 unique field names.
Limitations:
<ol>
Data will be either going into MS Access (testing) and then later on into SQL Server 2012 express<span>
(first few months) and then eventually into SQL Server 2012 Standard tables.Using .NET 4.0 and C# 4.0 Ideally no 3<sup>rd</sup> party libraries, but could be persuaded if very reasonable priced.</ol>
This is what I am thinking:<span> (probably with a bias to ease of setup as we have a time crunch).
<ol>
Generate multiple C# 4.0 classes from XSD files.Read in XML file into auto generated C# class (via Xsd.exe tool)Populate a DataSet table in-memory (strongly typed) using the same field names as found in classInsert in-memory Dastset rows into a table on disk where the field names are the same – How?<span>
re: field mapping: Not sure where to do this step (Xml to DataSet step or DataSet to DataTable set)
<ol>
Ideally I could override field mappings when necessary for when we want to make adjustments ( maybe 10% of the time?) when mapping source to dest field names.<span>
If no mapping exists, use the same field name and same field type kind of idea.How to override field mappings?<span> Hardcoded or some kind of template file where we don’t have to recompile?I don’t think we want to worry about changing field types here as we can deal with that later –but might be a nice option</ol>
</ol>
Note: Initially we are going to populate 50 fields into wide tables, then possibly move towards vertical tables like:
<span> VerticalTable1 (AutoNum*, TableName, FieldName, FieldValue, KeyFields, KeyValues).
Bonus Question : Is there an easy way to create strongly typed tables on disk from XML or from an XML populated class?
Is this the bonus answer? http://stackoverflow.com/questions/6291305/c-sharp-create-a-datatable-from-a-class-not-a-list-of-instances
http://stackoverflow.com/questions/6291305/c-sharp-create-a-datatable-from-a-class-not-a-list-of-instances
If this is the answer then have to figure out how to save in memory DataTable to hard disk table.

View the full article
 
Back
Top