create dataset from xml

  • Thread starter Thread starter Guest
  • Start date Start date
Import the System.Data.XML namespace and look at the object model for the
ReadXML method.

It is fairly straight forward and easy to use.
 
Give me a short sample of the the XML file with all tags present and some
bogus data and I can provide you with some code if you would like.
 
Thanks for Gerry's response!

Hi KPH,

Thank you for posting in the community!

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to import data from XML into a
DataSet. If there is any misunderstanding, please feel free to let me know.

As far as I know, this depends on the format of the XML. If the XML is
generated originally from a DataSet, using DataSet.WriteXml method, you can
just import it with DataSet.ReadXml method directly. If the Xml is in other
formats, we need to read the Xml into an XmlDocument and write some code to
import records one by one, or use XSLT to transform the Xml into the format
that can be read by DataSet.

For more information about DataSet.ReadXml and DataSet.WriteXml methods,
please check the following links:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemDataDataSetClassReadXmlTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemDataDataSetClassWriteXmlTopic.asp

HTH. Does this answer your question? If anything is unclear, please feel
free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Sorry Kevin, you're right. I assumed that he was using XML already
formatted correctly.

--
Gerry O'Brien
Visual Developer .NET MVP
 
Hi Gerry,

You're welcome. Everybody can make mistakes. ;-)

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top