![]()
Article posted by
Vuyiswamb on 12/3/2009 | Views: 6108 | Category:
Error and Resolution | Level: Beginner
If you found
plagiarised (copied) or inappropriate content,
please
let us know the original source along with your correct email id (to communicate) for further action.
Errors And Resolution encountered by Programmers in their daily life
Problem
Am not a fan of Ado.net in xmland that is because its sometimes so consfusing and time consuming if you have get a work around for a problem of mulformed tags in the xml, well i might not be a fan but the previous programmer whom i inherited the project from was a fan of XML. well in a web application everything is xml based, database manupilation is done in xml, a lot of serialization and desirialization. it will take you more that ten lines of code , doing the looping to save data to SQL through a large dataset , but if you use straight ado.net object it will take you 5 or less lines and it depends on the parameters. now lets get to the point of this Blog.
xml that reads
XML comment contains invalid XML: Whitespace is not allowed at this location".This is because in your Column fields that you pass to the Xml there is ampresant and in XML its a special character, now you need to turn it off. well in my case and your case its simple , you need to leave your code the way it and in your code where you pass the xml string, you must use the replace function in C# or Vb.net like this
Resolution
Xml.Replace("&", "& amp;");
the "&" will turn it off and everything will be good again.
Thank you for Visiting Dotnetfunda
Vuyiswa Maseko
If you like this article, subscribe to our
RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.
Found interesting? Add this to: