How and where are indexers in C sharp Arabic #63
Suggested Videos
❑ Where are indexers used in.NET.
❑ What are indexers in C#.
Where are indexers used in.NET
To store or retrieve data from session state or application state variables, we use indexers.
If you view the metadata of HttpSessionState class, you can see that there is an integral and string indexer defined. We use “this ” keyword to create indexers in C# . We will discuss about creating indexers in our next video session.
Another example of indexers usage in .NET .To retrieve data from a specific column when looping thru “SqlDataReader ” Object , we can use either the integral indexer or string indexer..
Right click on sqlDataReader calss, to view it’s metadata.Notice that ,there is an integral and string indexer defined.