Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a dataset with one row and one column. into that cell a have saved an xml ( created in sql server and convertet into a strinf)

How can I in vb. convert that string into an xml?
Posted

You can use different approaches offered by .NET FCL. Here is my short overview of them:
  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^].
  2. Use the class System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^].
  3. Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].


Besides, not in all cases you have to work with XML directly. In many cases, you can use serialization
http://en.wikipedia.org/wiki/Serialization[^],
https://msdn.microsoft.com/en-us/library/7ay27kt9%28v=vs.110%29.aspx[^].

In particular, you could use DataContract: https://msdn.microsoft.com/en-us/library/ms733127%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900