1 Replies - 2691 Views - Last Post: 24 August 2011 - 05:09 AM Rate Topic: -----

#1 pwtc222   User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 72
  • Joined: 02-July 10

Error:Too many characters in character literal

Posted 23 August 2011 - 11:42 PM

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>



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

anyone knows what causing this error?

MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 24 August 2011 - 04:14 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Error:Too many characters in character literal

#2 rgfirefly24   User is offline

  • D.I.C Lover
  • member icon


Reputation: 473
  • View blog
  • Posts: 2,221
  • Joined: 07-April 08

Re: Error:Too many characters in character literal

Posted 24 August 2011 - 05:09 AM

I'm guessing that your program is taking ' - ' and 'ACTIVE' to be CHAR which can only have one character within the ''. I'm not too familiar with what your trying to do so I can't give you a solution, but from the error you showed it would be an issue with the program interpreting the ''
s to be char.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1