Solved

Oracle .net provider give special character problems

Posted on 2004-04-07
11
480 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
 

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now