asp.net page uft-8 to ms sql

G

Guest

I have asp.net 2.0 site and it have uft-8 encoding. When I fill form and save
this to database in nvarchar(50) field (mssql 2000) I see simbols "??????"
if it was some not english text.
Why it happend?
Looks like mssql doent support utf-8. How can I check this?
 
G

Guest

I have asp.net 2.0 site and it have uft-8 encoding. When I fill form and save
this to database in nvarchar(50) field (mssql 2000) I see simbols "??????"
if it was some not english text.
Why it happend?
Looks like mssql doent support utf-8. How can I check this?

Try to add prefix N in your sql statement

INSERT ... VALUES (N'....', ......
 
G

Guest

Try to add prefix N in your sql statement

INSERT ... VALUES (N'....', ......

Wow. Cool, it works. Thanks a lot. But can you told me why?
ON my local pc it works without any N, but when I put this on hosting I need
modify queries to have this N. Why? It is some settings of database?
 
G

Guest

Wow. Cool, it works. Thanks a lot. But can you told me why?
ON my local pc it works without any N, but when I put this on hosting I need
modify queries to have this N. Why? It is some settings of database?

It means that server on remote host has different code page and when a
database got a unicode string and save it, any characters in the
unicode string that do not exist in the code page will be lost. When
you use prefix N you tell to database that you send unicode.

"N" stands for National Language in the SQL-92 standard and must be
uppercase
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top