.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

Error at reading xml data in C#.NET

Posted By: Sunil     Posted Date: December 08, 2008    Points:2   Category :Windows Application
Hi,

i am reading xml file in C#.NET my code is here

dataset ds = new dataset();
ds.readxml(filepath);
datagridview1.datasource = ds.table[0];

This code is working correctly some day before.

but now am getting Error on this line

ds.readxml(filepath);

Error is:- ' ', hexadecimal value 0x13, is an invalid character. Line 572, position 2748.

i am tired to solve it, can u please help me what this error,

Responses
Author: Amit Mehra             
Posted Date: December 08, 2008     Points: 5   

Hi,
It seems like there is some unicode character is available in your xml file. Just try to put encrypted Data into CDATA section like this then try to load data into dataset


<YourNode>
<![CDATA[encrypted data or unicode contains data]]]>
</YourNode>


or try like this


XmlReaderSettings xmlReaderSettings = new XmlReaderSettings();
xmlReaderSettings.CheckCharacters = false;

XmlReader xmlReader = XmlReader.Create(@"C:\yourXMLFile.xml", xmlReaderSettings );

DataSet ds= new DataSet();
ds.ReadXml(xmlReader);



Thanks,
Amit
Please "Mark As Answer " if this post help you.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend