TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jaganathan Bantheswaran
94
20.1k
3.2m
How to Iterate the List in Reflection.
May 10 2011 9:00 AM
Hi all,
I need a help on Reflection.
I am facing a problem while Iterating the List in reflection.
var item = property.GetValue(obj,null); //This will return List of Student. Actually We dont know the type of obj ie Student, as it is in Reflection.
foreach(var value in (item as IEnumerable))
{
//Do stuff
}
if i do like this i am getting error like,
Using the generic type 'System.Collections.Generic.IEnumerable<T>' requires 1 type arguments
Please help me.
Reply
Answers (
2
)
How to delete a file from folder in C#
Im new, how to open up 1 form in either Invoice or Quotes