阿拉伯字符未正确插入到Oracle数据库中(例如????)? [英] arabic character not inserted properly(like ????) in oracle database?
问题描述
阿拉伯字符不能通过asp.net插入到我的oracle数据库中.我使用以下代码将数据插入数据库,但未正确插入. 我该如何解决这个问题?
arabic character not insert to my oracle database with asp.net. I use below code to insert data to database but not inserted properly. how to can i solve this problem?
cmd.CommandText = "UPDATE SHAHR_POS SET SP_FLG=N'سلام'"
请帮助我.
推荐答案
根据文档 ODP.NET,托管驱动程序不依赖NLS_LANG
设置,仅依赖.NET语言环境.
According documentation ODP.NET, Managed Driver does not depend on NLS_LANG
settings, just on .NET locale.
检查您的CultureInfo.CurrentCulture
值.此页面如何:为ASP.NET网页全球化设置区域性和UI文化应该可以为您提供帮助.您必须设置一种支持阿拉伯字符的文化.
Check your CultureInfo.CurrentCulture
value. This page How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization should help you. You must set a culture which supports Arabic characters.
再次验证列SP_FLG
的数据类型为NVARCHAR2
,分别. NCLOB
(不是VARCHAR2
)
Verify again that data type of column SP_FLG
is NVARCHAR2
, resp. NCLOB
(not VARCHAR2
)
也尝试使用绑定变量:
cmd.CommandText = "UPDATE SHAHR_POS SET SP_FLG = :val"
cmd.Parameters.Add("val", OracleDbType.NVarchar2, ParameterDirection.Input).Value = "سلام"
这篇关于阿拉伯字符未正确插入到Oracle数据库中(例如????)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!