3

I'm looking into changing my application to load its xml format data files into DataTables (and a DataSet?) instead of deserializing them into classes. I can generate a dataset using xsd.exe, but I'm not having any luck finding any examples showing how to use it.

My Google searches have been hopelessly clogged with examples using xsd files as an intermediary in accessing database tables. Since my apps saving data files instead of querying a DB these aren't of any use to me.

0

2 Answers 2

6

Try out with. May be you need to format your xml.

    DataSet ds = new DataSet();
    ds.ReadXml("xml file path");
Sign up to request clarification or add additional context in comments.

2 Comments

Don't ask me how I failed to find that method with intelisense. I hate Mondays.
Say Dan - how did you miss that obvious function, even with Intellisense?? (sorry, just couldn't resist <evil grin>)
3

Is manually filling the schema and table an option?

DataTable table = new DataTable();
table.ReadXmlSchema(xmlReader);
table.ReadXml(xmlReader);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.