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

ASP.NET
ASP.NET(C#)
ASP.NET入门数据篇
C#Web应用程序入门经典学习笔记之一
ASP.NET2.0 WebRource,开发微调按钮控件
介绍几个ASP.NET中容易忽略但却很重要的方法函数
ASP.Net2.0 GridView 多列排序,显示排序图标,分页
ASP.NET 2.0 中的创建母版页
asp,asp.net学习教程下载
ASP.Net生成一个简单的图片
FCKeditor.Net_2.2安全修正版
ASP.NET与数据库相关技巧
在asp.net下实现Option条目中填充前导空格的方法
在ASP.NET中用MSDNURLRewriting实现Url Rewriting
在ASP.NET中实现多文件上传的方法
Community Server专题二:体系结构
在ASP.NET中重写URL的代码
asp.net下大文件上传知识整理
ASP.NET中常用的三十三种代码
asp.net下实现支持文件分块多点异步上传的 Web Services
ASP.NET 2.0,C#----图像特效处理

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


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