1 Reply Latest reply: Feb 12, 2013 11:22 AM by 987440 RSS

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


      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 ---------------------------------------

      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?