Question to Class

Hi,
within the class, there is already one property "Item" that is to retrieve data per given year and month.
    Default Public Overloads ReadOnly Property Item(Year As Integer, Month As Integer) As YearlySalesByShoesTypeMonth
        Get
            Return (From p As YearlySalesByShoesTypeMonth In Me Where p.Year.Equals(Year) AndAlso p.Month.Equals(Month) Select p).FirstOrDefault
        End Get
    End Property

    Default Public Overloads ReadOnly Property Item2(Year As Integer, WeekNumb As Integer) As YearlySalesByShoesTypeMonth
        Get
            Return (From p As YearlySalesByShoesTypeMonth In Me Where p.Year.Equals(Year) AndAlso p.WeekNumber.Equals(WeekNumb) Select p).FirstOrDefault
        End Get
    End Property

Open in new window

but I want to achieve the similar per relevant year and week number instead, so I declare "Item2" in above, while I've got the error below.

Error	23	'Default' can be applied to only one property name in a class.	

Open in new window


should I use another Class instead?
LVL 12
HuaMin ChenProblem resolverAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
Just remove "Default" from both properties, or just the Item2 property.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Naitik GamitSoftware DeveloperCommented:
When attempted to apply Default to more than one property name within a class, interface, or structure , error occurred

'Default' can be applied to only one property name in a <type>

Look at this msdn articles:
https://msdn.microsoft.com/en-us/library/t5ed9438(v=vs.90).aspx
https://msdn.microsoft.com/en-us/library/371ww4fs(v=vs.90).aspx
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.