troubleshooting Question

VB.NET need a class property to be a list array - part 2

Avatar of altariamx2003
altariamx2003Flag for Mexico asked on
Visual Basic.NET
12 Comments4 Solutions431 ViewsLast Modified:
sorry I dont know how to reopen  post

This is related to the post:
VB.NET need a class property to be a list array (https://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_27727643.html)

The solution that the expert give me works, but now I have another error:

"you did not controll nullreferenceexception" (sorry for my english)

this is the class with the change suggested for the expert
Public Class Item
    Private _itemno As String
    Public Property ItemNo() As String
        Get
            Return _itemno
        End Get
        Set(ByVal value As String)
            _itemno = value
        End Set
    End Property

   Public Sub New(ByVal ItemNo As String)

    End Sub

End Class


Public Class Accessory
    Private _items As List(Of Item)
    Public Property Items() As List(Of Item)
        Get
            Return _items
        End Get
        Set(ByVal value As List(Of Item))
            _items = value
        End Set
    End Property

    Public Sub New()
        _items = New List(Of Item)
    End Sub

End Class

Public Class MasterItem
    Private _item As Item
    Public Property PrimaryItem() As Item
        Get
            Return _item
        End Get
        Set(ByVal value As Item)
            _item = value
        End Set
    End Property


    Private _accessories As Accessory
    Public Property Accessories() As Accessory
        Get
            Return _accessories
        End Get
        Set(ByVal value As Accessory)
            _accessories = value
        End Set
    End Property
End Class

The problem is that if I remove  the function "Public Sub New(ByVal ItemNo As String) " from the class vb and I tried to use it
example
Show me the following error:
"Too many arguments for Public sub new()"
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 4 Answers and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros