如何赋值给类中类?
我也不知这样说法对不对,就是一个类中有个属性又是一个类,如何给这个属性赋值?
'
'此源代码是由 Microsoft.VSDesigner 2.0.50727.5485 版自动生成。
'
Namespace com.aisinogz.www
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="IEliWebServiceHttpBinding", [Namespace]:="http://webservice.companyInterface.dzfp.fp.aisinogd.com")> _
Partial Public Class ElectroniceInfo
Private bMB_BBHField As String
.
.
.
Public Property EMAIL() As String
Get
Return Me.eMAILField
End Get
Set
Me.eMAILField = value
End Set
End Property
'''<remarks/>
<System.Xml.Serialization.XmlArrayAttribute(IsNullable:=true)> _
Public Property details() As ElectroniceDetail()
Get
Return Me.detailsField
End Get
Set
Me.detailsField = value
End Set
End Property
.
.
.
End Class
Partial Public Class ElectroniceDetai
.
.
.
Public Property DW() As String
Get
Return Me.dwField
End Get
Set
Me.dwField = value
End Set
End Property
.
.
.
End Class
End Namespace
然后,在 Form1_Load
dim e_info as new ElectroniceInfo
dim e_detail as new ElectroniceDetai
e_detail.DW='test'
e_info. details=e_detail (运行到这里出错!) “未将对象引用设置到对象的实例”
另用 e_info.details.sevalue(e_detail,0), 也是这个出错!
现在想问一下 如何给 e_info.details 赋值呢?