Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Too many characters in character literal
An attempt was made to initialize a char constant with more than one character.
CS1012 can also occur when doing data binding. For example the following line will give an error:
<%# DataBinder.Eval(Container.DataItem, 'doctitle') %>
Try the following line instead:
<%# DataBinder.Eval(Container.DataItem, "doctitle") %>
The following sample generates CS1012:
// CS1012.cs
class Sample
{
static void Main()
{
char a = 'xx'; // CS1012
char a2 = 'x'; // OK
System.Console.WriteLine(a2);
}
}