Windows Phone Developers

Saturday, October 11, 2008

Solution : An object reference is required for the nonstatic field, method, or property 'member'

Solution : An object reference is required for the nonstatic field, method, or property 'member'

class Program

{

static void Main(string[] args)

{

sayhello();

}

public void sayhello()

{

Console.WriteLine("Hello World!");

}

}

In order to use a non-static field, method, or property, you must first create an object instance.

static void Main(string[] args)

{

Program mp = new Program();

mp.sayhello();

mp.find_defaulter();

}

public void sayhello()

{

Console.WriteLine("Hello World!");

}





Non Static Error Dialog


C# Console Output Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment