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

Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani

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

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

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

This code is working correctly some day before.

but now am getting Error on this line


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,

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

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

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

or try like this

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

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

DataSet ds= new DataSet();

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

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