Monday, February 13, 2012

ASP.NET MS SQL Server cyrillic problem

Hi,
I have a ASP.NET application which is hosted on English - based server. This
application works with MS SQL Server, also English-based. I have this in my
Web.config:
<globalization fileEncoding="windows-1251" requestEncoding="windows-1251"
responseEncoding="windows-1251" culture="bg-BG" uiCulture="bg-BG" />
When I insert some text in the database, I mean cyrrilic text, it couldn't
be read, because the result is '''.
Could you tell me hou should I fix this problem?
Thank you in advance!
ViktorVictor, first thing to look at is what's a data-type of the targeted field,
is nvarchar, nchar or ntext as opposed to varchar or text?
Also by what means is text inserted; bulk insert, ado, ado.net?
"Viktor Popov" <viketo@.yahoo.com> wrote in message
news:%232Rtw%23fLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have a ASP.NET application which is hosted on English - based server.
This
> application works with MS SQL Server, also English-based. I have this in
my
> Web.config:
> <globalization fileEncoding="windows-1251" requestEncoding="windows-1251"
> responseEncoding="windows-1251" culture="bg-BG" uiCulture="bg-BG" />
> When I insert some text in the database, I mean cyrrilic text, it
couldn't
> be read, because the result is '''.
> Could you tell me hou should I fix this problem?
> Thank you in advance!
>
> Viktor
>|||> Also by what means is text inserted; bulk insert, ado, ado.net?
I am sorry, I didn't pay attention to the title of your post. If your
web.config settings are correct that should work. But assuming user is
submitting double byte data.
"LP" <lp@.a.com> wrote in message
news:unRxTckLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> Victor, first thing to look at is what's a data-type of the targeted
field,
> is nvarchar, nchar or ntext as opposed to varchar or text?
> Also by what means is text inserted; bulk insert, ado, ado.net?
> "Viktor Popov" <viketo@.yahoo.com> wrote in message
> news:%232Rtw%23fLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> This
> my
requestEncoding="windows-1251"
> couldn't
>|||Do you mean that I should insert into database unicode?
Thank you for the reply!
"LP" <lp@.a.com> wrote in message
news:u7GHj8kLFHA.732@.TK2MSFTNGP12.phx.gbl...
> I am sorry, I didn't pay attention to the title of your post. If your
> web.config settings are correct that should work. But assuming user is
> submitting double byte data.
>
> "LP" <lp@.a.com> wrote in message
> news:unRxTckLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> field,
server.
in
> requestEncoding="windows-1251"
>|||Yes, you should insert cyrilic text as nvarchar or ntext. I am pretty sure
cyrillic uses double-byte i.e. unicode encoding.
"Viktor Popov" <viketo@.yahoo.com> wrote in message
news:%23O36bSrLFHA.1528@.TK2MSFTNGP09.phx.gbl...
> Do you mean that I should insert into database unicode?
> Thank you for the reply!
> "LP" <lp@.a.com> wrote in message
> news:u7GHj8kLFHA.732@.TK2MSFTNGP12.phx.gbl...
> server.
this
> in
>

No comments:

Post a Comment