asp.net page uft-8 to ms sql

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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'....', ......
 
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?
 
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
 
Back
Top