C# .NET - QB and C# example list of items not working.

Asked By Jeffrey Padfield on 27-Aug-13 03:50 PM
I'm using the QB and C# example found on this site. I've been able to get the list of customers to show just fine. The list of all items says that the instance is not set.

I've narrowed it down to this line of code.

IItemInventoryRet itemInventoryRet = itemRet.ItemInventoryRet;

Any idea why it would say its not set to an instance?
Robbe Morris replied to Jeffrey Padfield on 27-Aug-13 04:45 PM
That code sample checks to see if itemRet.ItemInventoryRet is null before it tries to use it.  I suspect that the initial query didn't return any values for that class type.  So, it did not initialize it with a new instance of the class.  Thus, it is null.
Jeffrey Padfield replied to Robbe Morris on 27-Aug-13 06:37 PM
There is roughly 100+ items in the itemRetList. Is there a way of checking for something else. I'm completely new to using C# with QB. I've tried itemRet.Type in the if statement and it still came back as the same error.
Jeffrey Padfield replied to Robbe Morris on 03-Sep-13 01:57 PM
Anything? I really need to get this working.
Jeffrey Padfield replied to Robbe Morris on 10-Sep-13 04:36 PM
I've tested the program some more. If there is only 1 item count it will show up. Seems like it is screwing up  after there are multiple items...