Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on 

VB.NET need a class property to be a list array

this post is just because I like to learn

a few minutes ago I found this problem on internet: http://stackoverflow.com/questions/1564318/vb-net-need-a-class-property-to-be-a-list-array

I check the example but the class has problems I tried to solve them

this is the class:
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

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

Open in new window



When I tried to use it:
 User generated image
It show me the following error:
"Too many arguments for Public sub new()"
Visual Basic.NET

Avatar of undefined
Last Comment
altariamx2003
ASKER CERTIFIED SOLUTION
Avatar of mwheeler1982
mwheeler1982
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of altariamx2003
altariamx2003
Flag of Mexico image

ASKER

ok

it works

thanks bro
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo