1

我基本上是在收集一个对象,并将其传递给一个方法,该方法使用该对象属性来填充文本框,并选择单选按钮、组合框项目和日期选择器日期......

我每隔三次或四次收到此错误并重新填充所有值:

AccessViolationException : 试图读取或写入受保护的内存。这通常表明其他内存已损坏。

有任何想法吗?

 Protected Sub PopulateForms(ByVal a As OMGService.OmgApp)

    Me.txtAppTitle.Text = a.Title

    Me.txtAppVersion.Text = a.Version

    Me.txtLicenseCount.Text = a.LicenseCount.ToString()

    Me.txtAppLocation.Text = a.AppLocation

    Me.txtDocLocation.Text = a.DocLocation

    Me.txtKey.Text = a.Key

    Me.txtAppNotes.Text = a.AppNotes

    Me.cBoxAppLicType.SelectedItem = Me.cBoxAppLicType.Items.Item(a.LicenseType)

    Me.radio64.IsChecked = a.IsX64

    Me.radio86.IsChecked = IIf(Me.radio64.IsChecked, False, True)

    Me.appInfoCreatedMsg.Text = String.Format("App Info Created: {0}", a.RecordCreated.ToString())

    Me.appInfoModifiedMsg.Text = String.Format("App Info Modified: {0}", a.LastModified.ToString())

    Me.txtOldPo.Text = a.OldCastlePO

    Me.txtAltTicket.Text = a.AltirisTicketNum

    Me.txtVendorName.Text = a.VendorName

    Me.txtRepName.Text = a.VendorRepName

    Me.txtRepPhone.Text = a.VendorRepPhone

    Me.txtVendorOrderNum.Text = a.VendorOrderNumber

    Me.txtTermsCond.Text = a.TermsConditions

    Me.DateOfPurchasePicker.SelectedDate = a.DateOfPurchase

    Me.OrderInfoCreatedMsg.Text = String.Format("Order Info Created: {0}", a.OrderRecordCreated)

    Me.OrderInfoModifiedMsg.Text = String.Format("Order Info Created: {0}", a.LastModified)

    Me.txtHiddenAppID.Text = a.AppID.ToString()

    Me.txtHiddenOrderId.Text = a.OrderID.ToString()

End Sub
4

0 回答 0