Archive for

Format XML using VB.Net

While working with xml it is more meaningful to the user if xml could appear in a hierarchical manner which can increase understandability. For example the below sample is preferable from perspective of readability and understandability: <?xml version=”1.0″?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body> <name>abc</name> <message>Don’t forget me this weekend!</message> </body> </note> while this detracts the … Continue reading

For XML Path in .Net – Ups and Downs

INTRODUCTION: We often write ‘FOR XML PATH’ queries in SQL to get data in XML form. Also we can extract unlimited data from a table via XML queries. The problem I am going to discuss today is how to read FULL contents of “FOR XML Path” sql query. I will describe various techniques to retrieve … Continue reading

This document already has a ‘DocumentElement’ node

This happens when we do not assign name to each row as well as root element. So by default system takes DocumentElement as node name which at later stage throws error on validating node.Here is a snap shot: To resolve this issue, we must have to assign name to the ROOT element. for example this … Continue reading

Error: Cannot serialize the DataTable. DataTable name is not set

This happens when we call WriteXml method of DataTable: This exception is raised when we serializes a DataTable when its TableName Property is not set. So, to stop getting this error you have to ensure that the DataTable have TableName property set. NOTE: This do not worth if you are using XMLDataDocument. But remember, XMLDataDocument … Continue reading