473,378 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Is there a way to do a property with an indexer?

bcg
I know that a Class can have an indexer, but can one or more
properties be created with an indexer? You could do this in VB6..
such as:

MyProperty (ByVal Index) As String
MyPropety = MyVal(Index)
Nov 15 '05 #1
1 1035
Sure. For example

public string this[]{...}
public string this[int] {...}
public string this[string] {..}
public string this[string, object] {...}
"bcg" <bg**********@hotmail.com> wrote in message
news:d9*************************@posting.google.co m...
I know that a Class can have an indexer, but can one or more
properties be created with an indexer? You could do this in VB6..
such as:

MyProperty (ByVal Index) As String
MyPropety = MyVal(Index)

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dotnetjunky | last post by:
Hi all Is it correct that there's a link between indexer and Items property in C# ? If yes, please show me what is it ? thanks in advance. -- Dotnetjunky
4
by: Dotnetjunky | last post by:
Hi, I'm really get confused on this issue. Hope that someone can help me get clear after this post. Take the class System.Web.Caching.Cache for example. In the documentation, there's a...
2
by: Nad | last post by:
Good day, I have a question about the Page.Session property used in ASP.NET This property is defined as follows: public virtual HttpSessionState Session {get;} and HttpSessionState is a...
15
by: Prachi Dimble | last post by:
Hi, In vb.Net one can pass arguments to properties. How does one achieve it in c#? Given below is the vb.net code for passing arguments to property getters and setters.. Thanks, Prachi ...
5
by: rwoo_98 | last post by:
I am trying to pass a reference to a method --SomeMethod. This table resides in a dataset and I refer to the datatable in the dataset using an indexer. However when I attempt to do this I get the...
4
by: Geordie | last post by:
Hi, I'm in the process of converting a production VS 2003 application to VS 2005. To simplify the conversion I'm converting a small piece at a time and then unit testing the code to confirm it...
8
by: Rainer Queck | last post by:
Hi NG, how can I implement more then one array property to a class? I have read about the Indexer, but as far as I can see this would only work for a Collection type of class like list or...
6
by: pinetaj | last post by:
Hello, I have a question of using 'property' on accessing elements of array. There is an array member in a class. I'd like to restrict accessing the elements of the array through property. And...
10
by: dfetrow410 | last post by:
Is there an example of how to store and access an array in a Property Dave
1
by: hufaunder | last post by:
I have found some examples on MSDN (http://msdn.microsoft.com/library/ default.asp?url=/library/en-us/csref/html/ vcwlkIndexedPropertiesTutorial.asp), Code Project, etc about property indexers. In...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.