System.Data.OracleClient, 8-bit chars, and Oracle US7ASCII character set RRS feed

  • Question

  • Hello,

    I am working with an ADO.NET 2.0 program that uses the Microsoft Oracle provider (System.Data.OracleClient) to read & write 8-bit (European) characters such as A-umlaut, etc. to an Oracle database. 


    The customer insists that the Oracle database character set (NLS_CHARACTERSET) must remain US7ASCII to support their Baan ERP system, which is using the same Oracle database.  


    However, 8-bit characters stored through ADO.NET to the US7ASCII character set database are translated by Oracle to ? (question mark).  


    While we know changing the Oracle database character set to WE8ISO8859P1 or AL32UTF16 will address the issue, the customer points out that 8-bit European characters are stored correctly without translation by Oracle SQL*Plus when the Oracle client characterset (NLS_LANG) is set to US7ASCII in the registry or environment.   However, the NLS_LANG setting does not appear to affect the behavior of ADO.NET (System.Data.OracleClient).  Does anyone know how to get ADO.NET to behave the same as SQL*Plus?



    Tuesday, July 1, 2008 9:18 PM


  • Try adding "unicode=true" to the connection string. When unicode flag is set, Microsoft Data Provider for Oracle will use UTF16 mode when making API calls.

    Saturday, July 5, 2008 8:00 AM