Why am I getting "Too many characters in character literal" here?

Why am I getting "Too many characters in character literal" here?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

I checked another project that compiles, and the line above is exactly the same...?


Clay Shannon,
author of historical works, novels, and art/poetry
http://www.knowitallsports.com/booklinks.aspx
0
ClayShannon
8/8/2008 2:38:35 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

3 Replies
620 Views

Similar Articles

[PageSpeed] 11

Are you sure that's the line causing the error?

That error usually happens when you use single quotes when you should have used double quotes. 


Please Mark As Answer posts that helped you.

"If we learn from our mistakes, I should be brilliant by now."

0
nikki_doer_of_things
8/8/2008 2:42:28 PM

nikki_doer_of_things:

Are you sure that's the line causing the error?

That error usually happens when you use single quotes when you should have used double quotes. 

That's the line that is highlighted when I 2-click the err msg.


Clay Shannon,
author of historical works, novels, and art/poetry
http://www.knowitallsports.com/booklinks.aspx
0
ClayShannon
8/8/2008 2:52:29 PM

 That thing isn't always the best at displaying the real cause of the error. Check both the aspx source and the code behind of your page and see if there are any single quotes. The error is likely caused by an incorrectly nested quote, or quotes when there should be double quotes.

A double quote is not the same character as two single quotes together, but depending on your editor font settings, it might look so close to the same that it's hard to tell the difference. 


Please Mark As Answer posts that helped you.

"If we learn from our mistakes, I should be brilliant by now."

0
nikki_doer_of_things
8/8/2008 3:05:19 PM
Reply:

Similar Artilces:

"Newline in constant" and "Too many characters in character literal" errors. Dataadapters and datatables.
I'm getting the above errors on line 41 (parameter delcaration)... been hitting my head on this for a while.. please help.  public static DataTable dtCleanVendorUsers(string username) {SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["VendorEvaluationConnectionString"].ConnectionString); SqlDataAdapter dataadapter = new SqlDataAdapter();dataadapter.SelectCommand = new SqlCommand("SELECT vendoruser_user_id, vendoruser_vendor_id, user_name, vendor_name, vendor_evaluated FROM vwVendorUsers WHERE (vendor_evaluated = 0) and (u...

Get "Mail"/"Get "News" / "Write"/"Post" buttons?
If the "Get Mail" button text changed to "Get News", and "Write" changed to "Post" when TB's in the news-reading mode, it would save me and probably others from constantly forgetting to make the change before proceeding. :-) Or is there an extension to do this which I don't know about? Thanks! Bob Bob P wrote: > If the "Get Mail" button text changed to "Get News", and "Write" > changed to "Post" when TB's in the news-reading mode, it would save me > and probably others...

how to get rid of "Carriage return" and "new line" ASCII character
I have a string which include severals lines, I want to make it into one line, replace "carriage return" and "new line" (~r~n) charater with space, how to do! Thanks! A loop that uses Pos (as_Source, "~r~n") and Replace (as_Source, li_CRLFPos, 2, " ") should do the trick. Good luck, Terry [TeamSybase] and Sequel the techno-kitten On Wed, 19 Jan 2000 11:00:42 +0800, lam <liuaim@163.net> wrote: >I have a string which include severals lines, I want to make it into one >line, >replace "carriage return" and ...

How can I get a "Result Column" or "Output Parameter" to return more than 255 characters in SYBASE ASE 12.5?
I am trying to return more than 255 characters in an output parameter in SYBASE ASE 12.5. It appears that you cannot have more than 255 characters for an OUTPUT parameter in Sybase 12.5? I get this error message "Character or binary data returned from Adaptive Server has been truncated. The client application does not support more than 255 bytes of data as a result column or output parameter." when I try to return more than 255 characters as an output parameter from Sybase. EXAMPLE: 1)Sybase result column example CREATE TABLE #test ( strNotes char(1000) ) SE...

"Get Mail" vs "Get All New Messages"
I have a few different email accounts set up in Thunderbird, and I'm using the unified view to view them. Recently, I noticed that the "Get Mail" button seems to only retrieve email for the first account (sometimes?). I'd like to click on that button and retrieve email for all of the accounts. I can get the behavior that I want consistently if I pull down the menu for "Get Mail" and select "Get All New Messages", but I'd prefer to get that in a single click if possible. I tried starting from scratch and recreating my profile, but I st...

Feature Request: "Get Extensions" and "Get Themes"
I think that when you click on the "Get Extensions" or "Get Themes" links, it should open depending on your default window-opening behavior. For example, all new windows for me open up in new tabs. However, when I click the "Get" links, they always open in new windows. I can't even find an extension to do this. How hard would this be to incorporate natively? ...

Resolved: Getting character encoding to "stick"
Found the setting I was looking for. Right-click on a folder in the folders pane, Properties > Default Character Encoding. -- Mike "Rocket J Squirrel" Bend, Oregon ...

Trying to change the Register link to "signup" or "get started"
Can someone please tell me where to change the text for the Register link. I would rather it say "signup" or "Get Started" or something. I have spent a long time looking for a place to change this, but im stumped. Any help is appreciated You can do this by modifying the resource file for the User control.  This is how it is accomplished: Goto the menu:  Admin->Languages. Open:  Local Resources->Admin->Skins->User.ascx.  It will ask you to "You are about to create a custom localized file for this portal. Are you sure you want to overload default localized fil...

Keep getting..."Unable to get project file from server",when using vs.net
When trying to open any existing asp.net project in Visual Studio it keeps giving me the message above. It is also throwing an error when I create the project in the first place, it happens when a dos window is opened, the text in the dos window is running "Common Language Runtime Minidump Utility version 1.0.3705.0" and then VS craps out says there was an error and shuts down. I've re-installed the .net components and framework with no avail, and FrontPage extensions etc.. are all installed. I'm running XP professional and have installed IIS 5.1. This is driving me fec...

wrong character display ("�" displays as "�" or "?")
Using ODBC Sybase 11 router, the character "�", saved in a varchar column in Sybase 11.5 will display as "�" or "?" in SQL Advantage or in our application. This just started occuring once we changed our applications to use 32 bit ODBC connection, rather than DBLib 16 bit. What is really interesting is that our our old 16 bit application runnning on the same PC returns the characters correctly, while 32 bit application running against ODBC returns another character, usually the degree symbol. Both versions of this program are accessing the same data sou...

Script to perform a "Get latest", then a "Build", then a "Publish"
I frequently have to copy out of source safe, the latest version of some source code. Then perform a build and then a publish. The publish is published to a local directory where I then copy it out to a server. This is a bit of a hassle to have to do all of this mannualy. What I would prefer to do is to use some type of script that would do this. Does anyone know if this is possible? I can manage copying to the server. I just need a script that I could kick off to do the following. 1. Copy the latest source code for the project out of source safe. 2. Perform a build of the projec...

TB3: Can't get Character Encoding to "stick"
I've got some strange characters in emails that didn't used to show when I was using TB2. If I change View > Character Encoding from Western (ISO-8895-1) to Unicode (UTF-8) the messages display fine. Trouble is, it doesn't stick. If I return to view the same message, the Character Decoding will have reverted back to ISO-8859-1. I have set Tools > Options > Display > Formatting > Advanced > Character Encodings Output Mail and Incoming Mail to Unicode (UTF-8), and while that sticks, it doesn't seem to override View > Character Encoding, which ...

IdPOP3 and stringlist: getting extra "3D" character in body of email
Hi, I'm using D2007. Just coded something to retrieve an email and then parse some settings that are in the body text of the email. Example (body of email): Number=1234 Language=English When I use a stringlist to retrieve the value of 'Number', I get 3D1234 instead of 1234. I output the body text to a memo and notice that all of the xxxx=yyyyy in the email, has an extra 3D in front of the value part (i.e. yyyyy). Code is below. Are the values getting screwed up with streaming to a stringlist?? Joe while IdPOP3.Retrieve(i,msg) do begin ...

Wierd Compiler Behavior, HTML characters being translated into character codes (i.e., "<" translated into "&lt;")
I was wondering if anyone has had a similar problem and what they did to solve it. I am trying to preview one of my pages in the browser, and trying to click on an ImageButton that I have setup to PostBack to another  page (i.e., PostBackURL=”~/someotherpage.aspx”). However, the ImageButton does not respond when I click it and does not post at all. I was wondering why, so I took a look at the HTML by viewing the source for the page and I found this:  <input type="image" name="ctl00$PageContentHolder$ImageButton1" id="ctl00_PageContentHolder_ImageBut...

Web resources about - Why am I getting "Too many characters in character literal" here? - asp.net.getting-started

Resources last updated: 11/25/2015 2:21:47 PM