-4

I am having a weird issue of storing Arabic numerals in Oracle. After investigation I found that C# is storing Arabic digits, ۱ to ۱۰ properly and transforming them into '?' character. How do I sort this thing out?

Code

sb_title = "ھیلو۱۲۳";
query = "INSERT INTO MyTABLE(SB_TITLE)VALUES('"+sb_title+"');
OracleCommand myCommand = new OracleCommand(query, this.myConnection);
affectedRows = myCommand.ExecuteNonQuery();

After thorough debugging what I found that variable does not temper the data but somewhere insertion mess the data. SB_TITLE is of type NVARCHAR

Oracle Connection String

sConnectionString = "User Id=xx;Password=xx;Data Source=XE";

Oracle Version

10g Express Edition

Volatil3
  • 14,253
  • 38
  • 134
  • 263

1 Answers1

1

Actually it is weird. Oracle Driver was dealing Arabic text as a non Unicode text but for numerals it needed actually unicode value. In my connection string I did not mention Unicode=True. What all I did that that I changed:

sConnectionString = "User Id=xx;Password=xx;Data Source=XE";

to

sConnectionString = "User Id=xx;Password=xx;Data Source=XE;Unicode=True";

And it worked like charm

Volatil3
  • 14,253
  • 38
  • 134
  • 263