怎样解决thephile中的数据库由于排序造成的问题:对 text 数据类型不支持代码页转换从: 1252 到: 936

2016-01-29 13:13 21 1 收藏

怎样解决thephile中的数据库由于排序造成的问题:对 text 数据类型不支持代码页转换从: 1252 到: 936,怎样解决thephile中的数据库由于排序造成的问题:对 text 数据类型不支持代码页转换。从: 1252 到: 936

【 tulaoshi.com - ASP.NET 】


怎样解决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/DownloadFilesa2004-09-20Table, 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

来源:https://www.tulaoshi.com/n/20160129/1489332.html

延伸阅读
在VB中,提供了很多数据类型转换的函数,特别是各种进制数据的转换以及字符串和数字的转换函数,本文将对这些函数做一个简单的小结. 1. 各种进制转换函数 一般的数据进制包括十进制,二进制,十六进制.十进制就是我们日常生活用到的数据进制,因此也是我们最熟悉和清楚的;二进制是计算机的基础进制,主要是因为便于用物理器件实现二进制...
标签: ASP
DbPath = "test.mdb"’数据库位置 ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(DbPath) Set Conn = Server.CreateObject("ADODB.Connection") Conn.open ConnStr Class Class_Read Public Arr,Rs,SQL,Ar...
本文定义了排序规则并介绍如何在 Microsoft SQL Server 中转换数据库的排序规则。有关 SQL Server 2000 的概念和讨论同样适用于 SQL Server 2005。 什么是排序规则? 排序规则指定了表示每个字符的位模式。它还指定了用于排序和比较字符的规则。排序规则具有下面的特征: ◆语言 ◆区分大小写 ◆区分重音 ◆...
一、其它数据类型转换为字符串 短整型(int)        itoa(i,temp,10);     //将i转换为字符串放入temp中,最后一个数字表示十进制        itoa(i,temp,2);      //按二进制方式转换 长整型(long)      &n...
   declare @i  int    set @i='a'    set @i=cast('a' as int)    set @i=convert(int, 'a')    print @i                           &n...

经验教程

830

收藏

38
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部