Home » C# Programming

Reserved Keyword


I am using a reserved keyword on my application: event. So I get the error:

Identifier expected; 'event' is a keyword

This is for a Events project so event seems a normal word to use in it. 

I think I can use @even for example in:

void Create(Event @event);

Should I try to change the name or is it ok to just add the @ before the name?




1 Answer Found


Answer 1

You *can*. But is may not be a good idea.

Check out this link:


Hope this helps.

Search for  Reserved Keyword



could you publish a list of reserved keywords in MDS (see my post :http://social.msdn.microsoft.com/Forums/en-US/sqlmds/thread/ac81f4e4-33bf-4c19-ba09-9d38b84408ea/)





I have a generated ESQL query that resolves to the following string:

"SELECT  c.AccountType,  c.Available,  c.BoMID,  c.Cost,  c.CountryOfOrigin,  c.DateCreated,  c.Description,  c.EOQ,  c.ExtendedDesc,  c.HTSCode,  c.InternalNotes,  c.isBoM,  c.ItemImage,  c.ItemType,  c.LastMod,  c.Link1,  c.Link2,  c.MakeBuyFlag,  c.Making,  c.ManualBuy,  c.MinStock,  c.NetStock,  c.OnOrder,  c.OnShelf,  c.OrderFlag,  c.Origin,  c.PartNumber,  c.Picked,  c.Price,  c.Product,  c.RecordID,  c.Revision,  c.Sold,  c.Status,  c.Stock,  c.Stocked,  c.Supplier,  c.SupplierPN,  c.Tags,  c.Using,  c  from Item as c where c.busactivityID=27"

As you can see, one of the column names is Using (the number of items currently in use).

This query produces the following error in EF4:

System.Data.EntitySqlException: 'Using' is a reserved keyword and cannot be used as an alias, unless it is escaped.

If necessary, I could rename the database column. However, I'd like to know how to escape or check for keywords to avoid problems in generated queries like this one.







I am using a reserved keyword on my application: event. So I get the error:

Identifier expected; 'event' is a keyword

This is for a Events project so event seems a normal word to use in it. 

I think I can use @even for example in:

void Create(Event @event);

Should I try to change the name or is it ok to just add the @ before the name?



When Negative keywords are added at the campaign, ad group, or individual keyword level,it does not return individual negative keyword Id,like for eg if it is added at campaign level,it only returns the campaign id,but does not return negative keyword id  in case of multiple negative keywords are added,so the problem is if i want to delete individual negative keyword,how will it be done since negative keyword id is not assigned to it.

I'm trying to setup Reporting Services on a little test/dev Server 2008 R2 box where I've got SQL Server 2008 R2 and Sharepoint 2010. I'm in the Configuration Manager on the Web Service URL step and no matter what I do it it says "We were unable to reserve the URL." It shows me the URL as being what I specify it to be but in the error message it looks like it might be trying to reserve the root directory. For example:


Report Server Web Service URLs:


Reserving url http://+:80

We were unable to reserve the URL.

I don't know if that is the problem or not, nor how to resolve it. I'm sure I'm missing something obvious as I'm pretty new to Server 2008 and the whole  2010 product line. When I click "tell me more" I get:


System.Runtime.InteropServices.COMException (0x80040211)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
   at Microsoft.ReportingServices.WmiProvider.RSWmiAdmin.ReserveURL(String application, String url, ErrorCodes& errorCode)
   at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.ReserveURL(UrlApplication app, String url, ErrorCodes& errorCode)




I am desperately hoping some expert here will be able to help me out.

We are facing a peculiar issue where in when we try and export a report, we are getting the default file name as "Reserved.ReportViewerWebControl.axd" instead of the actual report name.

We are working with SSRS 2005 SP2. All reports are server reports and are accessed through the report viewer control.

Any advice on why this issue is coming and how it can be resolved will be greatly appreciated.

Thanks in advance...


I see that Guest OS 1.4 finally addresses the issue of reserved characters not being encoded in a table storage query (see my previous post) - however the issue does not appear to be fixed in the development fabric?

I tried upgrading to the June SDK 1.2, and I have updated all my references to the storage client in this SDK - but I still get "Invalid Input" errors.

How can I replicate the correct behaviour in the dev fabric?




I wanted to use the "reseve" with a 2d vector, but it doesnt look like the documenation covers it.


#include <vector>

using namespace std;


vector<vector<double>> RatesA(1,vector<double>(1));

int main(void)


//Want to reserve for RatesA[361][1000];

RatesA.Reserve(361); //works, not sure what 300 refers too

RatesA.Reserve(361,1001); //error





I have installed the SQL Server 2005 Express and gave it to the SA's password: "password".
I know it is not right.
My question is, how they could know the password can not be the words of SQL Server 2005?


HI all,
 I need to have a sharepoint calendar where if I reserve a time that is being used from 12pm-2pm, another person/ same person can't come in and reserve the same time from 1pm-2pm  or 12pm -2pm for the same day. Is there an easy way to do this?

Hei Everyone..

Im having a problem in my application . I have a simple link to get redirect to a Liberty Reserve Merchant and the flow is after the success of the deposit in the LR, it supposed to come back in my asp code and save some details in the Database.

I dont have a problem with the deposit in the LR but it doesnt continue the flow. I dont understand why. Here is my sample code ( VB.net) code behind in the button


my function SaveIntoDB() is working properly but I dont know why after the response.redirect, 
it doesnt not Hit the function SaveintoDB()

Thank you


I have following two classes:

template <size_t size>
class Cont{
 char charArray[size];
template <size_t size>
class ArrayToUse{
 Cont<size> container;
 inline ArrayToUse(const Cont<size+1> & input):container(reinterpret_cast<const Cont<size> &>(input)){}

I have two following lines of code at global scope:

const Cont<12> container={"hello world"};
char (&charArray)[11]=ArrayToUse<11>(container).container.charArray;


In totality of my code The only usage of "container" object is for initialization of an object of "ArrayToUse" class as mentioned and after initialization of "charArray" reference to array I'll use that reference in rest of my code, now I'm wondering does compiler reserve memory for container object  since that's a temporary object?




I'm making an API call to a third party service -- sending data using JSON. I have a class that I convert to JSON using System.Web.Script.Serialization namespace. The problem I'm having is this: the API I'm calling is expecting data/value pair for "public". They use this for setting security for an object i.e. public: 1 makes it readable by everyone. I think you now see the problem. I can't set the name of the property in my class to public because it has a meaning in .Net framework. But the API I'm calling is expecting a property called public.

How do I get around this?


Hello and thanks for the forums!


I have a web site targeting framework 3.5 that uses web reports and a couple of them are causing me some headaches.  While I see on the forums and various places on the web different discussions regarding some of the same things I see in the errors, I don't really find anything that fits specifically what is occuring.  My users can eventually run the reports, but it takes 2 or 3 attempts before they do run.  I have been unable to duplicate the problem in development.  Everything I've read thus far says that there is a web.config handler missing but mine are in there.  But some of what I see being added as the handler is not necessarily what I have in mine and I'm curious if there might be a problem with how I have them entered.  I do have several other reports that never generate an error, so I'm at a loss as to what could be causing the problem.


First, the reportviewer dll's are in the bin folder.  My web.config has the following handler sections:

   <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        validate="false" />

      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


and my error info:


Script name: /mastercardlcm/Reserved.ReportViewerWebControl.axd 

 Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired or could not be found
   at Microsoft.Reporting.WebForms.ViewerDataOperation..ctor()
   at Microsoft.Reporting.WebForms.HttpHandler.GetHandler(String operationType)
   at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Anyone run into this problem of a report generating errors the first 2 or 3 attempts and then executing just fine before?


Thanks and Regards,




I keep getting this exception intermittently, it looks like a search engine is hitting my page even though I have a robots.txt file.  What is weird is look at the "Event" from Management Console (below).  The "Request URL" has "&amp;" in the URL.  If you copy and paste that request URL you get the same exception (my site hides the exception of course) If you copy and paste the URL and replace "&amp;" with just "&" then there is no exception and it returns a javascript file.  When I visit the reports page myself, everything works properly.  Like I said I am picking this up in my error logs and it throws quite a few exceptions all right in a row (like  5 of the same exceptions at the same time down to the second)

Has anyone encountered this? I am using this in my web.config:

      <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>

Event Type:    Warning
Event Source:    ASP.NET 2.0.50727.0
Event Category:    Web Event
Event ID:    1309
Date:        6/4/2007
Time:        4:21:36 PM
User:        N/A
Computer:    SV1803
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 6/4/2007 4:21:36 PM
Event time (UTC): 6/4/2007 11:21:36 PM
Event ID: 451314926608461980cfb5a89a038a94
Event sequence: 10588
Event occurrence: 4
Event detail code: 0
Application information:
    Application domain: /LM/W3SVC/1136884830/Root-1-128254433988287500
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\Inetpub\wwwroot\alliance\
    Machine name: SV1803
Process information:
    Process ID: 9316
    Process name: w3wp.exe
Exception information:
    Exception type: ArgumentException
    Exception message: Missing URL parameter: Name
Request information:
    Request URL: http://alliance.nmrdesign.com/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=8.0.50727.42&amp;Name=Scripts.ReportViewer.js
    Request path: /Reserved.ReportViewerWebControl.axd
    User host address:
    Is authenticated: False
    Authentication Type: 
    Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
    Thread ID: 1
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: True
    Stack trace:    at Microsoft.Reporting.WebForms.EmbeddedResourceOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response)
   at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


Is there a list of reserved characters for Project Server 2010?

I have been using the the Import Wizard in Project Professional 2010 to import projects into Project Server 2010 with no problem. However there is one project (an mpp file) that persistently will not import. No errors are detected during the import procedure, but an Error ID 11073 (LookupTableItemInvalid ...) is returned when saving the project at the end of the wizard.

Because of the nature of the contents of Task Names I can't help but to think there is a character(s) that Project Server doesn't like - similar to the "," character in Resource Names in Project Professional.

I have imported projects after experiencing the problem to this one project so my thinking is that it must be something unique to the project - the characters in the project is the only aspect of this project that is remarkably different than other projects. However, if there is a list of reserved characters I cannot find it.


I am using WIC in my application to read/write image metadata. Everything works perfect except for keywords not being recognized by Windows XP in the Summary properties tab.

Vista & 7 recognizes it properly in the Tags property.

I would greatly appreciate any pointers..


In Twitter a username is in the format @Username where a space should always be prceeding the name, but not necessarily at the end (i.e. might be a space, comma, period, etc.)  How would I make a regular expression to seek out these usernames in a String, but not pick up email addresses (i.e. somebody@hotmail.com); the space in front should differentiate the username.

Second question, almost identical to the 1st, a keyword in a twitter message begins with a pound sign like #Silverlight for the keyword of Silverlight.  In this case once again, should be preceeded with a space, but could end with a period, comma, dash, etc.

I have found a bunch of PHP reg expressions to accomplish this, but nothing in .NET.  Do the experts in this forum have any idea on how to create these expression in .NET?


You cannot vote on your own post

FLV to Divx converter for Mac OS X is a powerful software. With it, you can convert FLV video clips to Divx for Mac OS X , moreover, it can convert to any other formats at anytime. Now , let's start to use this type of miraculous Mac FLV to Divx Converter. FLV converter Mac  is a multiple function software. With the Mac FLV converter you can either convert FLV to AVI, MPEG, WMV, MPG, MP4, 3GP, XviD, DivX, DAT, MOV, MP3, WMA, OGG, etc. Or convert them to FLV to 3GP Mac  FLV FlashVideo format.Moreover, you can customize various options to make the software easiest for your demand.

Key Features of FLV Convert for Mac:

Designed just for Mac OS X Convert video for most popular players Extract audio from FLV MV or convert between audio files Various video and audio settings Capture pictures (bmp,jpg) from FLV Video Customize video effects Easy to use

No matter whether you are professional or not, you can apply easy-to-use FLV Converter for Mac very fluently. The considerable guides will be very helpful for you!

Step 1. Just click the "Add Files" buttton to load files, when you see the main interface of FLV Converter for Mac.

Step 2. According to your different demands, you can click the "Trim", "Crop" and "Effect" butttons to customize the output effects like: frame size, start/end time, brightness, contrast, saturation, and so on.

Step 3. You must to choose the output format Tod Converter Mac  from the Format list and set the destination folder by clicking the "Browse" button.

Step 4. Only click the "Convert" button to start Converting FLV for Mac.

Yes! Only four steps can you master the all-in-one FLV Converter for Mac. What's more, you have done the whole conversion perfectly. Free Trial is available! Why don't have a try?                                                                                        
FLV to Apple TV Mac                                                    
FLV to AVI Mac                                                    
FLV to Divx Mac                                                    
FLV to iPod Mac                                                    
FLV to MP4 Mac                                                    
FLV to MPEG Converter Mac                                                    
FLV to PSP Mac                                                    
FLV to WMV Mac                                                    
MTS Converter Mac                                                    
Mod Converter Mac                                                    

Flv to 3GP Converter for Mac OS X is a convenience application which was designed to convert Flv to 3GP for Mac OS X for your device. Such unique software can help you transfer to 3GP for Mac OS X freely. Besides, it also can convert to other formats as you like.


I am attempting to add a Label control to Form1 at run time using the button_Click() event handler. I am currently getting the following error message:

"Cross-thread operation not valid: Control 'mylabel1' accessed from a thread other than the thread it was created on. 

To date, using the code below mylabel1 is not visible on Form1. 
Any ideas?

//------Here is my code:

// Form1() constructor
this.mylabel1 = new System.Windows.Forms.Label();

// Form1 button click event handler
private void DiagButton_Click(object sender, EventArgs e)
    //place mylabel on Form1
    this.mylabel1.BackColor = System.Drawing.Color.Green;
    this.mylabel1.Font = new System.Drawing.Font("Microsoft Sans 
         Serif", 12F, System.Drawing.FontStyle.Italic,
          System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.mylabel1.Location = new System.Drawing.Point(476,627);
     this.mylabel1.Name = "mylabel1";
     this.mylabel1.Size = new System.Drawing.Size(68,26);
     this.mylabel1.TabIndex = 61;
     this.mylabel1.Text = "mylabel";
     this.mylabel1.ForeColor = System.Drawing.Color.DarkGray;
     this.mylabel1.UseCompatibleTextRendering = true;
     this.mylabel1.Enabled = true;
     this.mylabel1.Visible = true;


Thank you,
Jack McDaniel


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure