错误:字符文字中的字符过多 [英] Error:Too many characters in character literal

查看:85
本文介绍了错误:字符文字中的字符过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
部署Web应用程序时出现问题.
我的应用程序在网站应用程序中运行良好,但是当我转换为Web应用程序项目时,在编译时显示一些错误.

错误显示为-sql查询中的字符文字中的字符过多,

我在应用程序中使用数据集过滤开发人员Express Report中的搜索的地方.因此,错误来自.xsd文件,来自sql查询:

例如:

Hi all,
I''m having problem when deploying my web application.
My application runs fine in website application, but when i convert to web application project, its showing some errors when i compile.

The error shows as - Too many characters in character literal in sql query,

where i m using dataset in my application to filter search in my developer express report.So,the error is from .xsd file,from sql query :

example:

<CommandText>SELECT TOP (100) PERCENT CSGNDTL.ItemCode AS MBBTag, CAST(GRDTL.SerialNoList AS nvarchar(30)) AS SerialNumber, GRDTL.UDF_FANumber AS FANumber, GRDTL.UDF_CSCManagedNumber AS CSCManagedCode, Item.Description AS ModelNo, Item.Desc2 AS ModelName, ItemType.Description AS Classification, Location.Location + ' - ' + Location.Description AS Location, CSGN.CreatedUserID AS ApproveBy, CSGN.CreatedTimeStamp AS ApproveDate, Item.UDF_OwnerShip FROM CSGN INNER JOIN CSGNDTL ON CSGN.DocKey = CSGNDTL.DocKey INNER JOIN GRDTL ON CSGNDTL.ItemCode = GRDTL.ItemCode INNER JOIN Debtor ON CSGN.DebtorName = Debtor.CompanyName INNER JOIN Item ON CSGNDTL.ItemCode = Item.ItemCode INNER JOIN Location ON CSGNDTL.Location = Location.Location INNER JOIN ItemType ON Item.UDF_Classification = ItemType.ItemType INNER JOIN SerialNoTrans ON CSGNDTL.DtlKey = SerialNoTrans.DtlKey WHERE (CSGN.Description = 'ACTIVE') AND (Location.Location LIKE @Location) ORDER BY ApproveDate DESC</CommandText>




无论我在何处使用``-''和``ACTIVE'',该错误都会显示




the error shows at wherever i use the '' - '' and ''ACTIVE''

anyone knows what causing this error?

推荐答案

通常,单引号(即
'' ''

)用于指定2个字节的字符常量==>只有一个字符.
而当我们想使用字符串或多个字符时,我们使用双引号,即

are used for specifying character literal that is of 2 bytes ==> only one character.
Whereas when we want to use string or a number of characters, we use double quotes i.e.

" "

.
那就是问题所在.只需尝试将单引号更改为双引号,您就会在那里!
祝你好运!

.
Thats where the problem is. Just try changing single quotes to double and you''ll be there!
Good Luck!


这篇关于错误:字符文字中的字符过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆