473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Error message - Coding Error

126 100+
Hi Good Guys,
I need your help again. Please help me.
While compiling my former Developer C# 2008 program I encounter these error messages.

One of the error message is About DELEGATE. I have not heard of this before.


Error message:

Error 2'CShartNet2008GeneralApps.FrmDataGrid' does not contain a definition for 'btnExportXML_Click' and no extension method 'btnExportXML_Click' accepting a first argument of type 'CShartNet2008GeneralApps.FrmDataGrid' could be found (are you missing a using directive or an assembly reference?)

Coding from File Name: FrmDataGridDesigner.cs
Expand|Select|Wrap|Line Numbers
  1. this.btnExportXML.Font = new System.Drawing.Font("Verdana", 9F,       System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  2.             this.btnExportXML.Location = new System.Drawing.Point(472, -2);
  3.             this.btnExportXML.Name = "btnExportXML";
  4.             this.btnExportXML.Size = new System.Drawing.Size(119, 24);
  5.             this.btnExportXML.TabIndex = 4;
  6.             this.btnExportXML.Text = "Export XML File";
  7.             this.btnExportXML.UseVisualStyleBackColor = true;
  8.             this.btnExportXML.Click += new System.EventHandler(this.btnExportXML_Click);
  9.  
  10.  
--------------------------------------

Another error message


Error 13 Expected class, delegate, enum, interface, or struct

Coding from File Name : FrmDataGrid.cs
Expand|Select|Wrap|Line Numbers
  1.   private void btnExportXML_Click(object sender, EventArgs e); handles BtnExportXML.Click
  2.         {
  3.  
  4.         } 
Sep 19 '10 #1

✓ answered by ZiadElmalki

The first error is complaining because it cannot find btnExportXML_Click.

The other error is because btnExportXML_Click has the incorrect syntax and might not be nested inside a class. The stuff in bold is incorrect. There might be other errors else where in your code besides this. Post more if you need more help

private void btnExportXML_Click(object sender, EventArgs e); handles BtnExportXML.Click
{

}

3 1464
The first error is complaining because it cannot find btnExportXML_Click.

The other error is because btnExportXML_Click has the incorrect syntax and might not be nested inside a class. The stuff in bold is incorrect. There might be other errors else where in your code besides this. Post more if you need more help

private void btnExportXML_Click(object sender, EventArgs e); handles BtnExportXML.Click
{

}
Sep 22 '10 #2
Plater
7,872 Expert 4TB
Yeah, check to make sure the namespaces match and that the function is either defined in the same class (since it is private) or in the 'partial' class.

However, in cases like these.... I find it is just better to delete that code and remake it. Wipe it out and crate a new event handler then copy/paste the functional code into the handler
Sep 22 '10 #3
lenniekuah
126 100+
Hi ZiadElmalki and Plater,
Thanks to both of you for providing BEST ANSWER to my problem to dealing with the error message.
Sep 23 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mark | last post by:
Not sure this is the right place for this questions, but here goes: I get an error message when deleting an table from a Access database. The code is as follows and the error message is after...
4
by: Mark | last post by:
Not sure this is the right place for this questions, but here goes: I get an error message when deleting an table from a Access database. The code is as follows and the error message is after...
7
by: Leon Shaw | last post by:
Someone please help me understand the following error message: Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- ...
5
by: Kim Nørby Andersen | last post by:
Hello there I am lost. i receive the output in the bottom, from a site that runs excellently on our development server, but dies on the customer. We have had a first version running at the...
5
by: Kenneth P | last post by:
Hi, I get a Parser Error message when I try to start my asp.net app. Parser Error Message: Could not load type 'DiskoWeb.dLogin'. I have a code behind file and it's class name is dLogin. ...
1
by: mar-kav | last post by:
Hello, i'm a beginner so exuse me: i installed IIS 5.1, Framework1.1, vs .NET 2003 i put my web dir' in inetpub/wwwroot, tried to broows to my homepage under localhost & got this error message: ...
1
by: Bruce | last post by:
We suddenly got a mysterious error message on our Windows Server 2003 (SP1) after rolling out a bug fix on a web services application this morning. The application compiles and runs fine on the...
1
by: Andrew Fenyo | last post by:
Help!!! I have been developing an application, and suddenly, whenever I try adding data, or adding a control to a form, I get the above message. I have tried moving the file from our server to...
1
by: David Greenberg | last post by:
Hi In my DTS I am updating an Ingres database on a different server. I'm getting the following error immedtiately .... HResult of 0x80040e09 (-2147217911) returned Unexpected error occured. An...
3
by: lenniekuah | last post by:
Hi Good Guy, I am very surprised of the coding generate error message Error 1 Use of unassigned local variable 'strSql' even though the strSQL variable was declared. Not sure what is wrong...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.