This discussion is archived
1 Reply Latest reply: Feb 12, 2013 9:22 AM by 987440 RSS

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

987440 Newbie
Currently Being Moderated
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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points