oracle全库搜索字符串,ASP Web表单和Oracle数据库中的搜索字符串问题

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';"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值