Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

asp.net page uft-8 to ms sql

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SushiSean - 08 Sep 2007 00:44 GMT
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?
Alexey Smirnov - 08 Sep 2007 13:33 GMT
On Sep 8, 1:44 am, SushiSean <SushiS...@discussions.microsoft.com>
wrote:
> 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'....', ......
SushiSean - 10 Sep 2007 20:00 GMT
> 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?
Alexey Smirnov - 10 Sep 2007 22:01 GMT
On Sep 10, 9:00 pm, SushiSean <SushiS...@discussions.microsoft.com>
wrote:
> > Try to add prefix N in your sql statement
>
[quoted text clipped - 3 lines]
> 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.