<Serializable()> _ Public Class ICGOrder Public ServiceType As String = " " Public AccountNumber As String = " " Public AccountName As String = " " Public LoanType As String = " " Public LoanTerm As String = " " Public LoanAmount As Decimal = 0.0 Public AppraisedValue As Decimal = 0.0 Public AppraisalDate As Date Public Branch As String = " " Public InvestorCode As String = " " Public FormerOwner As String = " " Public Remarks As String = "" Public MailAddress1 As String = "" Public MailAddress2 As String = "" Public MailCity As String = "" Public MailState As String = "" Public MailZipCode As String = "" Public MailPlus4 As String = "" Public CollateralCount As Integer Public Collaterals As ICGCollateral() Public ClientSystem As String = "" Public EndUserEmail As String = "" End Class Public Class ICGCollateral Public PropertyAddress1 As String = "" Public PropertyAddress2 As String = "" Public PropertyCity As String = "" Public PropertyState As String = "" Public PropertyZipCode As String = "" Public PropertyPlus4 As String = "" Public PropertyCounty As String = "" Public PropertyType As String = "" Public PropertyLegalDescription As String = "" Public TaxingJurisdictionName As String = "" Public Parcel As String = "" Public AlternateParcel As String = "" Public AddressSame As Boolean = False End ClassGiven the above class definitions, how do I fill in the array (or collection?) of ICGCollateral objects when creating and filling an instance or ICGOrder? I tried this and blew up.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myorder As New localhost.ICGOrder() With myorder .ServiceType = "TAX CERT" .AccountName = "Newsom" .AccountNumber = "0123654" .Branch = "001" .ClientSystem = "SAC" .EndUserEmail = "jnewsom@icgtax.com" .LoanAmount = 100000.0 .LoanTerm = "360" .LoanType = "FHA" .Collaterals.SetValue(New localhost.ICGCollateral, 1) .Remarks = "Remarks." End With With myorder.Collaterals(1) .AddressSame = True .Parcel = "123-456-789" .PropertyAddress1 = "3130 Sundial Dr." .PropertyAddress2 = "" .PropertyCity = "Dallas" .PropertyCounty = "Dallas" .PropertyZipCode = "75229" .PropertyState = "TX" .PropertyLegalDescription = "Single family residence at stated address." .PropertyType = "Residential" End With End Sub