XML Related Clasees in .Net #18

XML in ADO.net VB.NET C#.NETXML is the foundation of .NET. .NET internally represents data as XML and hence can provide interoperability and interaction among applications written in different platforms and languages[.Net compatible].XmlReader

In .Net you can use XML with SqlCommand object. You first create a connection to the sql server database using the SqlConnection object. Then you can use a SqlCommand object with that SqlConnection object to query sql server databases(in XML format). You can use the ExecuteXmlReader() method to execute a query. A select operation will return data that can be grabbed into a XMLReader [similar to DataReader object] object. You know that in SqlCommand object you can specify the Query or the stored procedure name to execute. XmlReader object has a Read method like the DataReader object that helps to navigate through the nodes. Mentionable, the query must have FOR XML clause.

XML with DataSet

DataSet object has two methods to work with XML. You can use ReadXml to read a XML file or stream. Also, you can use WriteXml to write the contents of the DataSet to a file, stream, or an XmlWriter or TextWriter object.

XmlDataDocument Class

You can load XML data into a XmlDataDocument object[from a file or from a dataset]. DOM can be used to manipulate the data. A DataSet containing XML data can also be loaded into a XmlDataDocument object(constructor parameter).

XSLT Transform:

XmlDataDocument and XslTransform classes are used to transform XML from one form to another. A XslTransform object contains the style definition and loads a style file using it’s Load method. The Transform method of XslTransform transforms XML data according to the style sheet rules. Transform takes a XmlDataDocument[or objectes implemented IXPathNavigable interface] object as a source XML data to transform. Transform also, takes anothor parameter for the destination[a file, stream, XmlWriter, or TextWriter]

All these apply for both VB.net and C#.net.I will provide some code examples in future.

Have Fun. From: http://sitestree.com/?p=4755
Categories:18
Tags:
Post Data:2009-10-19 16:26:39

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>