Newbie error...

  • Thread starter Thread starter Carlos Sosa Albert
  • Start date Start date
C

Carlos Sosa Albert

Rusted, actually. But the results are the same (bad). LOL.
Hi guys,

I have the error "An object reference is required for the nonstatic field,
method, or property 'CoachLibrary.emailSender.checkBeforeSend(string)'" in
this class. Any hint gonna be welcome... =$

The method checkBeforeSend is something I didn't work on and was working
before.

Thanks a lot.

______________________________________________________
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CoachLibrary;

namespace User_Mode
{
public partial class Default : Form
{
emailSender emailsender = new emailSender();

public Default()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
emailSender.checkBeforeSend("exa");
}
}
}
 
Rusted, actually. But the results are the same (bad). LOL.

I have the error "An object reference is required for the nonstatic field,
method, or property 'CoachLibrary.emailSender.checkBeforeSend(string)'" in
this class. Any hint gonna be welcome... =$

The method checkBeforeSend is something I didn't work on and was working
before.

It's a casing problem. emailSender is the name of the class
(contravening .NET naming conventions, I might add) whereas emailsender
(lower-case s) is the name of the field.
 
LOL, you were right.

And yes... I know about the name convention. That was one of the reasons I
pointed it was not my work... ;)

Thanks a lot Jon!
 
Back
Top