PC Review


Reply
Thread Tools Rate Thread

Wrong interpretation of special characters ( Oracle provider )

 
 
Arjan Pottjewijd
Guest
Posts: n/a
 
      25th Aug 2003
Dear Sirs,

I think we found a bug within the .NET Oracle Provider (
System.Data.OracleClient ). When we try to update or
insert a varchar text into any oracle field with
characters like: "ė, č, ō, Ń, etc" the update fails. A
wrong character will be inserted.

Here is a code example:

System.Data.OracleClient.OracleConnection myConnection =
new System.Data.OracleClient.OracleConnection
("my connectionstring");

System.Data.OracleClient.OracleCommand myCommand =
myConnection.CreateCommand();

myCommand.CommandText =
"Update tablename set fieldname = " +
":myValue where id= :myID";

myCommand.Parameters.Add(":myValue",
System.Data.OracleClient.OracleType.VarChar,50);

myCommand.Parameters.Add(":myID",
System.Data.OracleClient.OracleType.Number);

myCommand.Parameters[":myValue"].Value = "My problėm.";
myCommand.Parameters[":myID"].Value = 10;
myCommand.ExecuteNonQuery();

The value "My problėm." will not be updated / inserted
correctly because of the ė character.

A work- around would be:

System.Data.OracleClient.OracleConnection myConnection =
new System.Data.OracleClient.OracleConnection(
"my connectionstring");

System.Data.OracleClient.OracleCommand myCommand =
myConnection.CreateCommand();

myCommand.CommandText = "Update tablename set fieldname
= 'My problėm' where id= 10";

myCommand.ExecuteNonQuery();

But if this is the only solution it would mean a lot of re-
programming for us to a worse situation.

I hope anyone has a better workaround or more information
about this issue.

Best regards,

Arjan Pottjewijd.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sequence.nextval numeric type in Oracle 10g differs from Oracle 8i when using MS OleDb provider alasdair.johnson@gmail.com Microsoft ASP .NET 0 27th Apr 2007 06:57 PM
emails with the wrong special characters =?Utf-8?B?dG9wcmhpbm8=?= Microsoft Outlook Discussion 0 19th Jul 2005 03:32 AM
Access, Oracle and Special Characters Arno Weiershaeuser Microsoft Access External Data 1 24th Aug 2004 01:21 PM
error while connecting to oracle from Microsoft .net data provider for oracle Reny J Joseph Thuthikattu Microsoft VB .NET 8 16th Aug 2004 01:48 PM
Oracle Connection Problem with Microsoft .NET Provider for ORACLE =?Utf-8?B?QW5kcmV3?= Microsoft ADO .NET 7 11th May 2004 04:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:11 PM.