954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Unable to save unicode characters into database

Hi,

I'm working on a content management system for our website (ASP.NET project, C# language, SQL Server 2000), but I'm unable to save russian texts into the database. Table is okay, I've created an ntext column, which is able to store unicode characters.

However, if I'll look into the database field, all I'll find are questionmarks, instead of russian characters...

My datacommand looks like this:

dataCommand.CommandText = "UPDATE texts SET title = '" + TextBoxRU.Text + "';";


Can you help me with this? Is it necessary to change the command somehow?
Stivi

Stivi
Light Poster
26 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Okay, so after a few hours of Googling, I found the solution :) Just to show the way to others with the same problem: http://www.microsoft.com/globaldev/DrIntl/columns/001/default.mspx#E6B

Anyway, the command string should look like this:
dataCommand.CommandText = "UPDATE texts SET title = N'" + TextBoxRU.Text + "';";

Stivi
Light Poster
26 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Thanks dear....i really missed that N

possible181
Newbie Poster
1 post since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You