当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 怎样解决thephile中的数据库由于排序造成的问题:对 text 数据类型不支持代码页转...

ASP.NET
.Net将如何影响我们?(一)
.Net将如何影响我们?(二)
开发者面临的.Net挑战(一)
开发者面临的.Net挑战(三)
.Net的精髓-XML和SOAP(一)
.Net的精髓-XML和SOAP(二)
.Net的精髓-XML和SOAP(三)
.net的reflection (1)
.net的reflection (2)
Asp.net编写的PING工具
.NET语言的选择
且看微软的.Net和Sun公司的J2EE如何对垒
从 Visual Basic 6.0 到 Visual Basic.NET 的转换(1)
从 Visual Basic 6.0 到 Visual Basic.NET 的转换(2)
从 Visual Basic 6.0 到 Visual Basic.NET 的转换(3)
从 Visual Basic 6.0 到 Visual Basic.NET 的转换(4)
从 Visual Basic 6.0 到 Visual Basic.NET 的转换(5)
什么是配件(assembly)?
什么是映射(reflection)?
从一个舆论调查的制作谈面向对象的编程思路(一)

ASP.NET 中的 怎样解决thephile中的数据库由于排序造成的问题:对 text 数据类型不支持代码页转...


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 70 ::
收藏到网摘: n/a


怎样解决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 src/DownloadFiles\a\2004-09-20\Table, 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