Creating Writable Properties Using the set Accesso
I have a simple class that I am writing using properties. When I attempt to access the value of one of the properties I receive this error:
An object reference is required for the nonstatic field, method, or property 'RC2003.member.mLname'
Here is a code snippet:
public class member
{
private string mFname, mLname;
public string LastName
{
get {return mLname;}
set {mLname = value;}
}
public static void UpdateMember(int ID)
{
// SQL STUFF
objCmd.Parameters["@mFname"].Value = mFname;
}
}
}
I also tried accessing the property LastName. I'm not entierly sure that I am using the propeties the correct way. Is this right? What am I missing?
Thank you,
-- shawn
|