IEnumerable<t></t>
-
hi. How can I return IEnumerable az a method parameter. In fact I want to return a table records. but I must return as IEnumerable; How can I fill IEnumerable and return it?
-
hi. How can I return IEnumerable az a method parameter. In fact I want to return a table records. but I must return as IEnumerable; How can I fill IEnumerable and return it?
Hi, you have to write a class that will implement the IEnumerable interface. Within the implementation you can move through your records. Have a look here: http://msdn.microsoft.com/en-us/library/system.collections.ienumerable%28VS.80%29.aspx[^] By the way, if you are using the System.Data.Table then the Rows-Property offers a GetEnumerator() method which will return an enumerator for the records within the table. Regards Sebastian
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
-
Hi, you have to write a class that will implement the IEnumerable interface. Within the implementation you can move through your records. Have a look here: http://msdn.microsoft.com/en-us/library/system.collections.ienumerable%28VS.80%29.aspx[^] By the way, if you are using the System.Data.Table then the Rows-Property offers a GetEnumerator() method which will return an enumerator for the records within the table. Regards Sebastian
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
a world of thanks. I 'll try to do it
-
hi. How can I return IEnumerable az a method parameter. In fact I want to return a table records. but I must return as IEnumerable; How can I fill IEnumerable and return it?
Other than that, you can also use any class implemented from IEnumerable like Array, ArrayList, List etc... to return IEnumerable object. :)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml> -
hi. How can I return IEnumerable az a method parameter. In fact I want to return a table records. but I must return as IEnumerable; How can I fill IEnumerable and return it?