Sunday, May 19, 2013

C# Error: 'Too many characters in character literal'

In coding a Windows 8 application, I was receiving the error 'Too many characters in character literal'.  Not sure why this was occuring. In my defense, with X++, you can use either even though double quotes should always be used for text that is not defined in a macro.

Solution: The issue is because single quotes were used in the string text. They should be double quotes. Single quotes should only be used for single characters only whereas double quotes should be used for more than one character.

Correct: ""   Incorrect: ''

No comments:

Post a Comment