Click here to Skip to main content
11,644,286 members (64,299 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET instance objects
The following code generates these two troubleshooting tips in
The code builds with no errors.
The locals window lists everything under OrderContext as "Nothing", 0.0 or "False" when it stop on the line which attempts to set address1.

Troubleshooting tips:
"Use the new keyword to create an object instance."
"Check to determine if the object is null before calling the method."

[code begin]
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim PEService As New PayService
        Dim OrderContext As New com.nicusa.cdc.tpe2_ks.WSOrderContext
        OrderContext.customer.address.address1 = "1233 Test Dr." = "Test City"
        OrderContext.customer.address.state = "KS" = "66999"
[code end]

[edit]code block added[/edit]
Posted 27-Nov-12 11:36am
Edited 27-Nov-12 11:56am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Does the constructor New com.nicusa.cdc.tpe2_ks.WSOrderContext also create an instance of customer, or is OrderContext.customer Nothing?
I guess that's what happens. Hence, also construct a customer object, and likely also an address object, and set the properties.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 610
1 484
2 Afzaal Ahmad Zeeshan 453
3 Sergey Alexandrovich Kryukov 369
4 CPallini 352
0 OriginalGriff 925
1 DamithSL 636
2 Afzaal Ahmad Zeeshan 622
3 Sergey Alexandrovich Kryukov 548
4 CPallini 521

Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 28 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100