A
ats@jbex
I have a class in VB.Net named PartyDetails. The class has a number of
Properties, 1 Sub and 2 Functions.
The Sub is Public Sub New() and the functions are:
Public Function GetParty(ByVal pno as Long) As PartyDetails
Private Function GetPartyFromReader(ByVal reader as SqlDataReader) As
PartyDetails
These are both styled on the MembershipUser class.
On my form I have the following:
Dim p as PartyDetails = Nothing
p = Party.GetParty(pno)
This gives the following error at the above line:
Reference to a non-shared member requires an object reference.
If I change it to the following:
Dim p as PartyDetails = New PartyDetails(some properties)
p.GetParty(pno)
then everything works OK until I try to access any of the PartyDetails
properties. I then get an error telling me to use the New call or to check
for Null values first. There are no null values in the PartyDetails class
and I cannot get this to work.
Any help would be much appreciated.
TIA
--
ats@jbex
The world is my expense
The cost of my desire
Jesus blessed me with its future
And I protect it with fire
Rage Against The Machine - Sleep Now In The Fire
Properties, 1 Sub and 2 Functions.
The Sub is Public Sub New() and the functions are:
Public Function GetParty(ByVal pno as Long) As PartyDetails
Private Function GetPartyFromReader(ByVal reader as SqlDataReader) As
PartyDetails
These are both styled on the MembershipUser class.
On my form I have the following:
Dim p as PartyDetails = Nothing
p = Party.GetParty(pno)
This gives the following error at the above line:
Reference to a non-shared member requires an object reference.
If I change it to the following:
Dim p as PartyDetails = New PartyDetails(some properties)
p.GetParty(pno)
then everything works OK until I try to access any of the PartyDetails
properties. I then get an error telling me to use the New call or to check
for Null values first. There are no null values in the PartyDetails class
and I cannot get this to work.
Any help would be much appreciated.
TIA
--
ats@jbex
The world is my expense
The cost of my desire
Jesus blessed me with its future
And I protect it with fire
Rage Against The Machine - Sleep Now In The Fire