473,405 Members | 2,349 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,405 software developers and data experts.

Difference between Ienumerator an Ienumerable interfaces

Difference between Ienumerator an Ienumerable interfaces.
example in vb.net
Oct 1 '08 #1
2 2347
vekipeki
229 Expert 100+
Google says:

IEnumerator: http://msdn.microsoft.com/en-us/libr...r_members.aspx

IEnumerable: http://msdn.microsoft.com/en-us/libr...e_members.aspx

But usually you don't have to worry about implementing any of these interfaces, you will just expose a public IEnumerable method - check MSDN for C# "yield" keyword, the example there is what you will probably use all the time:

http://msdn.microsoft.com/en-us/libr...f0(VS.80).aspx
Oct 1 '08 #2
vekipeki
229 Expert 100+
Oooops, sorry, I just realized you wrote VB.net, not C# - there is no "yield" in VB.net, you actually have to implement these interfaces manually.

Check MSDN for examples of how to use them. http://msdn.microsoft.com/en-us/libr...numerable.aspx
Oct 1 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Hans | last post by:
I implemented the IEnumerator interface in some classes to enable the use of the foreach statement. As you probalbly know, the interface asks for the implementation of object IEnumerator.Curren...
2
by: yyhhjj | last post by:
I created a test program to implement an iterator. First, I used 'yield break' in the iterator, it worked normally. Then, I simply used 'break' in the places of 'yield break', it still worked...
3
by: starter | last post by:
I am trying to learn IEnumerator and collections(ArrayList, Hashtable) in .NET. Can anyone tell me what is IEnumerator used for and any online resources would be helpful. Thanks
3
by: rossum | last post by:
I have been trying to get the IEnumerable interface to compile, and am having some difficulties. When I try to compile: class TestIEnum : IEnumerable<string{ string theStrings; public...
5
by: Shikari Shambu | last post by:
Hi, I am trying to implement a collection that implements IEnumerable<T>. I keep getting the following error 'IEnumerator<...>.Current' in explicit interface declaration is not a member of...
3
by: EmilH | last post by:
Hi. I have read some examples of IEnumerator at http://www.codeproject.com/csharp/csenumerators.asp What if I have 2 arrays or collections, for example a DataSet which has 2 DataTables in my...
3
by: cody | last post by:
Why was this design decision to use this kind of "duck typing" in that case? All you have to do is have a method GetEnumerator() which returns an object providing Current and MoveNext()....
3
by: =?Utf-8?B?VGVycnk=?= | last post by:
I have made up a contrived example show the problem I am having. I have some ReadOnly interfaces: Public Interface IROPerson ReadOnly Property FirstName() As String ReadOnly Property LastName()...
0
by: James | last post by:
Hello, Can anyone please explain me what is the difference between IEnumerable and IEnumerator ? Thanks, James
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.