怎样解决thephile中的数据库由于排序造成的问题:对 text 数据类型不支持代码页转换。从: 1252 到: 936 ------------------------------------------------------------ 问题: 最近我在看《Asp.net Web站点高级编程 提出问题-设计方案-解决方案》的论坛部分,在调试Topic.aspx页面时,出现如下错误: The error occurred in: http://localhost/ThePhileVB/WebModules/Forums/Topic.aspx?TopicId=50
Error Message: 对 text 数据类型不支持代码页转换。从: 1252 到: 936。
Error Stack: System.Data.SqlClient.SqlException: 对 text 数据类型不支持代码页转换。从: 1252 到: 936。 at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) ...(以下略) ------------------------------------------------------------- 该问题是由于设计标的时候,原数据库采用的是: 英语(美国) 0x409 Latin1_General 1252
而由于操作系统的缘故,我们需要的是 简体中文(中华人民共和国) 0x804 Chinese_PRC 936 ,
1.生成两个不同的数据库,thePhile,thePhileTemp,从backup文件中还原数据;生成thephile的sql脚本;删掉thephile中的所有用户表。 2.把脚本中的 COLLATE SQL_Latin1_General_CP1_CI_AS改成 COLLATE Chinese_PRC_CI_AS 3.利用sql脚本重新生成thephile中的表; 利用sqlserver中的工具,从thePhileTemp中导出数据,导入到thePhile中 ok 
|