Resolved Class with class properties: aObject reference not set to an instance...

vagueante

Active member
Joined
Feb 20, 2009
Messages
28
Location
Portugal
Programming Experience
10+
Hi,

I have a class in which some of the fields are also classes.

I can put values in the "normal" properties, but in the others when o try to assign values it gives the: "Object reference not set to an instance of an object"

But the code compiles fine.


VB.NET:
dados_Defenicao = New ServiceReference1.draftClaimEntryDefinition

dados_Defenicao.arCode = "123"
dados_Defenicao.claimMarket.warrantyType = "w" - Here it gives the error

How can i fix this ?
Thanxs
 
Last edited:
I was really distracted, ClaimMarket is a class, so i have to create a new instance

VB.NET:
dados_Defenicao = New ServiceReference1.draftClaimEntryDefinition

dados_Defenicao.arCode = "123"

Dim clClaimMarket As New claimMarket
clClaimMarket.warrantyType = "Warranty data"
dados_Defenicao.claimMarket = clClaimMarket

Fixed :)
 
Back
Top