Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ReadXmlFileToDataSet()
Message
 
To
01/11/2004 11:02:27
Bill Benton
North Florida Software Services
Middleburg, Florida, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00956485
Message ID:
00956862
Views:
19
Bill,

I don't know about the Mere Mortals Framework, but you can read XML into a
DataSet very easily w/ the .NET Framework.


DataSet ds = new DataSet();

ds.ReadXml("filename.xml", XmlReadMode.InferSchema);
ds.AcceptChanges();



If you have a large XML that you are reading, you want to create and add an XML Schema to the project, because reading it will be MUCH, MUCH faster.

You can create a Schema like this.



DataSet ds = new DataSet();

ds.ReadXml("filename.xml", XmlReadMode.InferSchema);
ds.WriteXmlSchema("file.xsd");



You can then, add the XSD to your project, and have Visual Studio .NET generate a DataSet and you will use a typed DataSet



MyDataSet ds = new MyDataSet();
ds.ReadXml("filename.xml");



I hope that helps.

Morgan
Previous
Reply
Map
View

Click here to load this message in the networking platform