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");
}
}
}

Re: Newbie error... by Jon

Jon
Wed Jun 06 14:44:30 CDT 2007

<"Carlos Sosa Albert" <betun (at) hotmail>> wrote:
> 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.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Re: Newbie error... by Carlos

Carlos
Thu Jun 07 07:54:23 CDT 2007

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!

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.20d11ef2487a48781c2@msnews.microsoft.com...
> <"Carlos Sosa Albert" <betun (at) hotmail>> wrote:
>> 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.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too