Click here to Skip to main content
13,092,862 members (68,417 online)
Rate this:
Please Sign up or sign in to vote.

When i try to retrieve swedish characters like Ö Å é from the database into the dataset, it is displayed as Ö Ã… é when I view the dataset values by debugging.

How do I correctly retrieve the data?

I have tried the following which didn't work:
1. In code behind:
Dim currentCultureInfo As New CultureInfo("sv-SE")
        dataSet.Locale = currentCultureInfo

2. In web.config :
<globalizatio<n fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="sv-SE" uiCulture="en-US" /> 

Kindly help me sort this issue.
Thanks in Advance !!!
Posted 8-Nov-12 20:33pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

try UTF-32 since UTF-8 might not be able to represent all the characters
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

2 things:
What kind of data type do you set for text fields? Probably you need NVARCHAR instead of VARCHAR

You need to encode data...
To set the encoding for an individual page, set the RequestEncoding and ResponseEncoding attributes of the @ Page directive, as shown in the following example:

<![CDATA[<%@ Page RequestEncoding="utf-8" ResponseEncoding="utf-8" %>]]>

See related links:[^]
Using Character Encoding in ASP.NET[^][^]

More about encoding and globalization for ASP.NET, you'll find here:[^]

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 |
Web01 | 2.8.170813.1 | Last Updated 9 Nov 2012
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