When a client of Oracle 9i or later is connected to a server of Oracle 8i or later versions, all the Chinese data queried becomes garbled. The query finally solved the garbled problem.
The development tool is ASP. NET (C #) + Oracle, using system. Data. oracleclient to connect to the Oracle database.
Solution 1 (the first item can be left blank, but make sure that the server side is the same as the client Character Set ):
1. Enter the SQL plus input command: Select userenv ('language') from dual; the query Character Set result is
Simplified chinese_china.zhs16gbk.
2.
Start-run-type regedit to enter the registry, just in case, first back up the registry, then find the HKEY_LOCAL_MACHINE-SOFTWARE-ORCALE, you can see the name of the nls_lang item, change its data (key value) to: Simplified chinese_china.zhs16gbk
3.
In the Oracle directory, if there is a homeo item in other sub-directories, click homeo, you can also see the nls_lang item and delete it. If there are homeo1 and other items, the following nls_lang items will be deleted.
4. Disable the registry.
5. Check whether garbled characters are resolved in the test result of running the program.
6. Note: you can disable the 1st items first. Make sure that the character set of the client and server is the same.
Solution 2: Connect using system. Data. oledb to avoid Chinese garbled characters.