-4

I was assigned to do a task.... I have a page with some text boxes and a save button, when I enter values to the textboxes and click save button data will be saved to the databases.

In SQL Server the datatype of all columns is varchar. In some cases the data will not be saved properly, and click save button at that time no error will be displayed, but all the values will be disappeared.

I think some symbols are not supported using varchar. I am not sure what was the problem, plz help me

4

1 回答 1

5

varchar在 SQL Server 中仅支持非 Unicode字符,因此如果您有西里尔文、希伯来文、阿拉伯文、中文或其他“非拉丁”字符,您将丢失其中的一些字符。

请参阅有关 char 和 varchar的官方MSDN 文档:

varchar [ ( n | max ) ]

可变长度、非 Unicode字符串数据。

nvarchar(n)改为用作您的数据类型 - 这将存储Unicode文本并保留所有这些特殊字符

于 2013-06-24T06:09:46.450 回答