Solved

Oracle .net provider give special character problems

Posted on 2004-04-07
11
484 Views
Last Modified: 2008-02-07
When storing special characters in an Oracle table using the Microsoft Oracle .net provider the characters are being translated.  The special characters are any that have an accent or an umlaut.  The translations are consistent with each character entered.  The example below is one of the translations.
é = é

We could switch to the Oracle .net provider, but that would require substantial effort, and I am not sure it would fix the problem.

Please advise.
0
Comment
Question by:acraig1
  • 6
  • 5
11 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10777415
What is the field type for the database table?

Bob
0
 

Author Comment

by:acraig1
ID: 10778060
VARCHAR(6)
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10778116
In SQL Server there is a field type nVarChar that can handle international characters.  Would it be an option to change the field type?  Does Oracle have that option?

Bob
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 

Author Comment

by:acraig1
ID: 10778316
Oracle is handling the international characters fine if we insert them via SQL+ or Toad.  When we insert via the .net data provider we get the jumbled results.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10778435
What are you using to write the data to the field?

Bob
0
 

Author Comment

by:acraig1
ID: 10778467
I am using sql assigned to the CommandText of the OracleCommand object, and I am using bind variables to populate the data using the OracleCommand.Parameters.add method.  This sql is working with all other types of data, not international characters.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 10778481
What is the code that you use to add the parameters?

Bob
0
 

Author Comment

by:acraig1
ID: 10783552
cmd.Parameters.Add (attribName, OracleType.NVarChar,100);
0
 

Author Comment

by:acraig1
ID: 10783569
cmd.Parameters[attribName].Value = parameterValue;
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10783914
Wow, I don't understand why this would be doing this to you!

I looked through some things, and I have to ask, as a test, if you could try this with the Oracle OleDb provider?

Bob
0
 

Author Comment

by:acraig1
ID: 10784941
The problem was with the addition of the parameters.  Your prompting me to look in that direction made me look into each of the available types.  Updating from nVarChar to just VarChar fixed the problem.  After more research I discovered the n in nVarChar stands for national.  So, I am guessing VarChar is international.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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