O'Reilly Forums: Cs1061 Error In Chapter 1 - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cs1061 Error In Chapter 1 Don't know enough to fix it

#1 User is offline   OldDog,NewTrick 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 24-February 13

Posted 24 February 2013 - 04:22 PM

I hit an error when I compile my Contacts app in chapter 1: C:\Users\me\Documents\Visual Studio 2010\Projects\Contacts\Contacts\Form1.Designer.cs(242,66): error CS1061: 'Contacts.Form1' does not contain a definition for 'contactIDLabel_Click' and no extension method 'contactIDLabel_Click' accepting a first argument of type 'Contacts.Form1' could be found (are you missing a using directive or an assembly reference?)

I've searched the forum with no hits and Googled the error, but I don't understand how to apply the pro's answers to my Chapter I problem; I don't understand what I'm doing enough to know how to fix it. I've got a little SQL under my belt, but I'm fairly new to coding.

Here's the Form1.cs:
namespace Contacts
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void pictureBox1_Click(object sender, EventArgs e)
{
MessageBox.Show("Contact List 1.0.\nWritten by: me", "About");
}

private void peopleBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.peopleBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.contactDBDataSet);

}

private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'contactDBDataSet.People' table. You can move, or remove it, as needed.
this.peopleTableAdapter.Fill(this.contactDBDataSet.People);

}

private void ContactIDLabel_Click(object sender, EventArgs e)
{

}
}
}


How do I use what the debugger is telling me to fix it?

Thanks in advance,

Old Dog
0

#2 User is offline   Sikta_26785 

  • Active Member
  • PipPipPip
  • Group: Members
  • Posts: 67
  • Joined: 18-May 11

Posted 24 February 2013 - 06:39 PM

View PostOldDog,NewTrick, on 24 February 2013 - 04:22 PM, said:

private void contactIDLabel_Click(object sender, EventArgs e)
{

}


Change that "c" in contactIDLabel to lowercase like I did in the quote. Or, if you aren't going to use the method (my suspicion), delete it and go into the properties tab for your contactIDLabel and remove the assigned method name from the button click event by clicking the lightning bolt icon and then deleting the assigned method. It is assigning the method with the "c" as lowercase. You could also change it to uppercase in the properties tab to fix this.

This post has been edited by Sikta_26785: 24 February 2013 - 06:39 PM

0

#3 User is offline   OldDog,NewTrick 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 24-February 13

Posted 25 February 2013 - 08:22 AM

View PostSikta_26785, on 24 February 2013 - 06:39 PM, said:

Change that "c" in contactIDLabel to lowercase like I did in the quote. Or, if you aren't going to use the method (my suspicion), delete it and go into the properties tab for your contactIDLabel and remove the assigned method name from the button click event by clicking the lightning bolt icon and then deleting the assigned method. It is assigning the method with the "c" as lowercase. You could also change it to uppercase in the properties tab to fix this.



Thank you! I changed the capital "C" to a lowercase "c" and I'm not getting the error. (That was my bad - I'm used to PL/SQL being fairly case-insensitive, and was trying to fix the field to look better, before we got to the section where the book showed us how to change the text in the properties.) I left the method in, just because I don't remember the chapter telling me to remove it - I'll check the text when I get home tonight. :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users