Chinese garbled characters in Oracle Development (2)

Source: Internet
Author: User

C # It is common to access Oracle, but there are various exceptions in the actual work. I would like to analyze and summarize them as follows for convenience in the future:
The character set of a database is commonly used in two ways:

US Code simplified chinese_china.us7ascii

China Code simplified chinese_china.zhs16gbk

Connection method:

1. oledb connection

 
{Provider = msdaora.1; user id = Martin; Password = 1; Data Source = orcl; Unicode = true; Integrated Security = yes; persist Security info = false}
 
{Provider = oraoledb. Oracle; user id = Martin; Password = 1; Data Source = orcl; Unicode = true; persist Security info = false}

Oledb connects to Oracle in two ways: different drivers written by Microsoft and Oracle.
Provider = msdaora.1 is a driver written by Microsoft

Provider = oraoledb. Oracle is the built-in driver of oracle.

Summary:
Use the oledb connection driven by msdaora.1. No garbled characters are found whether the database character set is us7ascii or zhs16gbk, it may be caused by the inconsistent character set between the local Oracle Database and the server Oracle database. You need to modify the variable nls_lang in the registry. However, when msdaora.1 is used on x64 OracleProgram. That is to say, msdaora.1 does not support 64-bit oracle.
Use the oraoledb. Oracle-driven oledb connection, which supports China Code zhs16gbk very well. If the Oracle character set is US-encoded us7ascii, the data is read without garbled characters, and the Chinese parameters passed as the where condition are garbled characters.
Oraoledb. Oracle is not affected by Oracle's 32-bit or 64-bit.
2. Other Connection Methods

Refer to blog:

Http://blog.csdn.net/jack_33/article/details/7620100;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.