Link to home
Start Free TrialLog in
Avatar of acraig1
acraig1

asked on

Oracle .net provider give special character problems

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.
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

What is the field type for the database table?

Bob
Avatar of acraig1
acraig1

ASKER

VARCHAR(6)
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
Avatar of acraig1

ASKER

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.
What are you using to write the data to the field?

Bob
Avatar of acraig1

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of acraig1

ASKER

cmd.Parameters.Add (attribName, OracleType.NVarChar,100);
Avatar of acraig1

ASKER

cmd.Parameters[attribName].Value = parameterValue;
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
Avatar of acraig1

ASKER

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.