The error is pretty explicit:
An object reference is required for the non-static field abso.load()
What it means is that the class
Abso
declares a method called
Load
like this:
public void Abso()
{
...
}
Which means that is it an
instance method
: it needs an instance of the
Abso
class to work.
Ignore computers for a moment, and think about cars:
What colour is your car?
What colour is my car?
What colour is this car?
What colour is that car?
These are all valid questions because they specify the car that you are interested in - because all cars are not the same colour, you can;t ask:
What colour is a car?
And if you try, people will look at you rather strangely!
Conversely, you can ask
How many wheels has a car?
because all cars have four wheels - if they had two they would be a motorcycle!
"What colour?"
is an
instance
question - it requires an instance of a car ("your car", "my car", "that car over there, beside the lamppost") before you can ask it.
"How many wheels?"
is a
static
question - you don't need to specify a vehicle to get an answer.
In C# we have the same things - an
instance method
requires a specific class instance because it can access instance related data, properties, and methods, and a
static method
does not (and can't access anything which is not explicitly declared as
static
either, without locating or creating an instance of the class).
So look at your
Abso
method and decide if it needs to access instance related data or not.
If it doesn't, then declare it as
static
:
public static void Abso()
{
...
}
If it does, then call it via an instance:
Absolutly.Abso abso = new Absolutly.Abso();
abso.Load();