Introducing DotNetFunda.com on mobile http://m.dotnetfunda.com ! Be with DotNetFunda.com on the go !
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 2469 |  Welcome, Guest!   Register  Login
Home > Articles > Error and Resolution > Whitespace is not allowed at this location

Whitespace is not allowed at this location

1 vote(s)
Rating: 5 out of 5
Article posted by Vuyiswamb on 12/3/2009 | Views: 6108 | Category: Error and Resolution | Level: Beginner red flag


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.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

Experience:8 year(s)
Home page:http://www.Dotnetfunda.com
Member since:Sunday, July 06, 2008
Level:NotApplicable
Status: [Member] [MVP] [Administrator]
Biography:Vuyiswa Junius Maseko is a programmer and a moderator in ".NetFunda. Vuyiswa has been developing for 8 years now. his major strength are C# 1.1,2.0,3.0,3.5 and sql and his interest are in Silverlight,WPF,C#. He has been doing a lot of Silverlight development. He has been using .net since the beta version of it. He is also an online Trainer at www.Itfunda.com. Thanks to people like Sheo Narayan (.Netfunda) , Chris Maunder (codeproject), Colin Angus Mackay (codeproject), Dave Kreskowiak (Codeproject),.They have made vuyiswa what he is today.
>> Write Response - Respond to this post and get points
Related Posts

This article tries to troubleshoot the error: An attempt to attach an auto-named database for file <C:\database file path> failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. This article tells the step by step procedure to handle this type of error.

I always Blog about the Errors i got that are no Common, but i realised that few people might know about my Bloggs, so i decided to write an Article based on the Error and Solution from uncommon errors in the Programming World.

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2012 7:28:53 AM