I have search form where i want user to search something from a oracle database in Arabic language.
I have done all possible (as far i can research) i.e. set the oracle column datatype to NVARCHAR, changed the asp.net charset etc but nothing seems to work.
For testing purpose i create a test page and entering Arabic text and saving it in database, i noticed that the Arabic text converted to "????? ??????", based on this test i come to conclude that the Arabic text is not properly passing to the oracle database, thus not returning any search results(although the data is there for searched string).
i also used response.write to see the sql script it is showing correctly i.e.
but as seems at the database end its not properly passing the value and converting to some garbage values "????? ??????" (based on the attached screens)
Where am i going wrong , i strongly feels its on the oracle end, please help.
i am using
1. asp.net 4.0
2. Oracle 10g
3. using System.Data.OracleClient (i can't change it)
Talk1:
sorry forgot to add response.wrtie string, here it is, note i can't add a image to posts, sorry. select * from PRODUCTMASTER where PRODUCTDESCAR like N'%المول سينفكس%'
Solutions1
It depends on the database and national character set. I think you have to change the character-set or create new database with proper character-set.
You can check your DB character setas below:
SELECT *
FROM v$nls_parameter
WHERE name LIKE '%CHARACTERSET'
You have to choose between the 2 most popular Oracle Arabic character-sets: AR8MSWIN1256 or AR8ISO8859P6. There are also some cases where you have to use UTF8.
See below urls:
Talk1:
thanks , i checked the character set is already set to Arabic i.e. AR8ISO8859P6, note if i run the above posted query directly in oracle db its working fine but when i run the same query from asp.net its not returning any result.
Talk2:
one more thing the query you posted returning error message "ORA-00904: "NAME": invalid identifier", i used this query instead and it works for me "select * from nls_database_parameters where parameter='NLS_CHARACTERSET';"