Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

Newbie error...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carlos Sosa Albert - 06 Jun 2007 20:24 GMT
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");
       }
   }
}
Jon Skeet [C# MVP] - 06 Jun 2007 20:44 GMT
> Rusted, actually. But the results are the same (bad). LOL.
>
[quoted text clipped - 4 lines]
> 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.

Signature

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

Carlos Sosa Albert - 07 Jun 2007 13:54 GMT
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!

>> Rusted, actually. But the results are the same (bad). LOL.
>>
[quoted text clipped - 10 lines]
> (contravening .NET naming conventions, I might add) whereas emailsender
> (lower-case s) is the name of the field.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.