Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to insert and retrieve Unicode data using Microsoft OLE DB Provider

987440Jan 29 2013 — edited Feb 12 2013
Hi,

I have an ASP.NET web application that uses OLEDB connection to Oracle database.

Database: Oracle 11g
Provider: MSDAORA
ConnectionString: "Provider=MSDAORA;Data Source=localhost;User ID=system; Password=oracle;*convertNcharLiterals*=true;"

When I use SQL Develeoper client and add convertNcharLiterals=true; in sqldeveloper.conf then I am able to store and retrieve Unicode data.

The character sets are as follows:
Database character set is: WE8MSWIN1252
National Language character set: AL16UTF16

Select * from nls_database_parameters where parameter in ('NLS_CHARACTERSET','NLS_LENGTH_SEMANTICS','NLS_NCHAR_CHARACTERSET');

PARAMETER VALUE ---------------------------------------
NLS_CHARACTERSET WE8MSWIN1252
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CHARACTERSET AL16UTF16

I have a test table:

desc TestingUni
Name Null Type
---- ----
UNI1 VARCHAR2(20)
UNI2 VARCHAR2(20)
UNI3 NVARCHAR2(20)

I execute the below mentioned query from a System.OleDb.OleDbCommand object.
Insert into TestingUni(UNI3 ) values(N'汉语漢語');

BUT when retrieving the same I get question marks (¿¿¿¿) instead of the Chinese characters (汉语漢語)

Is there any way to add the above property(convertNcharLiterals) when querying the Oracle database from OLEDB connection?
OR is there any other provider for Oracle which would help me solve my problem?
OR any other help regarding this?


Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2013
Added on Jan 29 2013
1 comment
1,940 views