Despite the fact this deals with webservices I believe it is a VB question.
I am working on a test application that passes data to a webservice.
The webservices takes a variable type that is defined below:
Public Class Variable
Inherits MarshalByRefObj ect
'<remarks/>
Public strVariableName As String
'<remarks/>
Public objVariableValu e() As Object
End Class
My code is as follows
Dim varList(2) as Variable
varList(0) = New Variable
varList(0).strV ariableName = "Name"
varList(0).objV ariableValue = New Object <- Error Occurs Here
varList(0).objV ariableValue(0) = name
If I use the above code I get a "Specified Cast is not Valid" error.
If I code it this way...
Dim varList(2) as Variable
varList(0) = New Variable
varList(0).strV ariableName = "Name"
varList(0).objV ariableValue(0) = name <-- Error Occurs here
I get "Object reference not set to an instance of an object." as my
error. What am I missing?
I am working on a test application that passes data to a webservice.
The webservices takes a variable type that is defined below:
Public Class Variable
Inherits MarshalByRefObj ect
'<remarks/>
Public strVariableName As String
'<remarks/>
Public objVariableValu e() As Object
End Class
My code is as follows
Dim varList(2) as Variable
varList(0) = New Variable
varList(0).strV ariableName = "Name"
varList(0).objV ariableValue = New Object <- Error Occurs Here
varList(0).objV ariableValue(0) = name
If I use the above code I get a "Specified Cast is not Valid" error.
If I code it this way...
Dim varList(2) as Variable
varList(0) = New Variable
varList(0).strV ariableName = "Name"
varList(0).objV ariableValue(0) = name <-- Error Occurs here
I get "Object reference not set to an instance of an object." as my
error. What am I missing?
Comment