1  /  1  页   1 跳转 查看:1380

不能比较或排序 text、ntext 和 image 数据类型

不能比较或排序 text、ntext 和 image 数据类型

建立了一个多选项的字段
对它进行搜索的时候提示

不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): 不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。]  System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +862234  System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739110  System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188  System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956  System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31  System.Data.SqlClient.SqlDataReader.get_MetaData() +62  System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297  System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +903  System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132  System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32  System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122  System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12  System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7  System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141  System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137  System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83  Ky.SQLServerDAL.SqlHelper.ExecuteTable(String connectionString, CommandType cmdType, String cmdText, SqlParameter[] commandParameters) +155  Ky.SQLServerDAL.Create.GetField_InfoList(Int32 modelType, String tableName, Int32 chId, Int32 colId, String fieldName, String keyword, Int32 pageIndex, Int32 pageSize, Int32& recordCount) +563  Ky.BLL.B_Create.GetField_InfoList(Int32 modelType, String tableName, Int32 chId, Int32 colId, String fieldName, String keyword, Int32 pageIndex, Int32 pageSize, Int32& recordCount) +38  List.BindInfo() +169  List.Page_Load(Object sender, EventArgs e) +1886  System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15  System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34  System.Web.UI.Control.OnLoad(EventArgs e) +99  System.Web.UI.Control.LoadRecursive() +47  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
 

回复:不能比较或排序 text、ntext 和 image 数据类型

稍等,查看先。
最后编辑胡显明 最后编辑于 2008-01-08 10:36:28
我就是乖宝宝,酷源CMS的发展离不开大家的共同努力,承接定制项目. 有任何使用问题都请随时联系我,免费为您解答各种疑难杂症.
 

回复:不能比较或排序 text、ntext 和 image 数据类型

呵呵,好快啊!我测试了几遍都是相同问题!
 

回复:不能比较或排序 text、ntext 和 image 数据类型

问题在于不能够对 text、ntext 和 image 数据类型 进行等于搜索

目前为了搜索减少服务器负担,除了对标题,关键字等外是模糊搜索,其他字段均是等于搜索
 

回复:不能比较或排序 text、ntext 和 image 数据类型

我感觉还是强化下搜索比较好,虽然搜索页面能自定义
但搜索条件很不灵活,想一想,字段都自己定义了
不能模糊搜索,也不能范围搜索,例如价格等,用起来还是有很大限制的

现在好多网站的内容显示都是靠搜索实现的
 

回复:不能比较或排序 text、ntext 和 image 数据类型

恩,我们考虑下吧。
我就是乖宝宝,酷源CMS的发展离不开大家的共同努力,承接定制项目. 有任何使用问题都请随时联系我,免费为您解答各种疑难杂症.
 
1  /  1  页   1 跳转

版权所有 酷源CMS政府信息公开系统 | 酷源子网站集群系统 | 远程发布系统   Sitemap

Powered by Discuz!NT 2.1.202    Copyright © 2001-2008 Comsenz Inc. 蜀ICP备07500489号
返顶部