Click here to Skip to main content
12,997,531 members (58,926 online)
Rate this:
Please Sign up or sign in to vote.
See more:
My web service returns DataTable having string values with special character likes "å", "ä", and "ö"

So Its throwing an error "There is an error in XML document"

I search on net found that I need to work around serialization
But I am not getting exactly

Another solution I found, is replace special character

If you have any help link regarding this highly appreciated

Posted 30-Apr-11 1:28am
Kim Togo 30-Apr-11 7:51am
Are use using DataTable.WriteXml method? - This should not give you any problems for special characters. Just remember to use the right encoding class: UTF-8
Khaniya 30-Apr-11 22:36pm
No I am calling web service which return DataTable
I am try to call like
DataTable tbl= WS.GetRecord();

where it gives mention error
Kim Togo 2-May-11 9:39am
Okay, perhaps it is the web service that do not encoding it correct?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Check your Encoding in XmlWriterSettings for the XmlWriter object.

XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 30 Apr 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100