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

ASP.NET
many-to-many多对多映射
.NETRemotingChannelListener
转载李建忠老师的一篇文章
原创ColorComboBox控件
用IDisposable接口释放.NET资源
c#v2.0 扩展特性 翻译1
XPath中如何比较不同类型的对象
用哈希表搜索对象
C#陷阱int i = 10; i += i++; i =
Make a window that pops up from taskbar
获取网站返回的头部信息
自己动手写屏保
在DataGrid中添加Radio单选按钮列
实现性能目标的几种方法
增强.NETFramework中线程的功能
ASP.NET 2.0,写无限级下拉菜单不再难
book_dotnet
用.NET武装你的头脑
准备你的发布阶段
移植到.NET

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 52 ::
收藏到网摘: 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