Solved

System.Data.OracleClient caracters ª

Posted on 2010-11-11
2
430 Views
Last Modified: 2012-08-13
Hello,

We have the next problem:

We have a application in VS2010 with Framework 3.5
We use System.Data.OracleClient

The application work sucesfully, but when we read some caracters of oracle database, we obtained ????

For example with the caracter ª we obtain ?

We don't install Oracle client in the clients.
If we install Oracle client in the clients then we obtain the caracter sucesfully.

But our goal is don't install oracle client in each client.

What can I do?

Thanks.
0
Comment
Question by:david-shm
  • 2
2 Comments
 
LVL 6

Accepted Solution

by:
Greg Clough earned 500 total points
ID: 34111443
You need to check the NLS_LANG settings on your client, which I'm presuming is windows. This must match whatever your PC "codepage" is set to. Check in the registry for HKLM/Sofware/Oracle, and it may be something like:AMERICAN_AMERICA.WE8MSWIN1252Then you need to ensure that your database can store the character you're trying to store. I presume you're running AL32UTF8?  You can check this by querying:SELECT value$ FROM sys.props$ WHERE name = 'NLS_CHARACTERSET' ;
0
 
LVL 6

Expert Comment

by:Greg Clough
ID: 34111604
Actually, the fact that your database is returning "?" for unknown characters almost positively identifies it as a US7ASCII database, which was the default for a long time. This means that you can only store characters in the 7-bit range, which is basic a-zA-Z0-9, etc.If you want to store extended Ascii, or other languages that need other characters (À, Ø, ®, etc.) then you need to switch to a new database character set. The easiest decision, and the most future proof is AL32 UTF8. There are implications on database size, but you'll need to be informed about what your exact requirements are before make the switch.WARNING: Do not set your NLS_LANG on your Client to match your Database. This will bypass the character translation code built into Oracle, and will cause you pain in the future. It may appear to work, but you'll be storing corrupt data. The only time the NLS_LANG on your Client should match the Database is when the client is actually running the same characterset. (I'm sure there's some cyclical logic in there, but hopefully it's clear)
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question