Can you store multiple data types in System.Array?
Answer Posted / alok yadav
Yes, its possible try the below sample
replace manageAdvertisement with your class
System.Array ar=Array.CreateInstance(Type.GetType
("System.Object"),3);
ar.SetValue("asdfas",0);
ar.SetValue(1, 1);
ManageAdvertisement mg=new ManageAdvertisement();
mg.AdvertisementDesc="123124";
ar.SetValue(mg, 2);
foreach (object obj in ar)
{
Response.Write( obj.GetType() +"<br>");
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is difference between ilist and list?
Why singleton pattern is used in c#?
Can I use parseint?
What is default access modifier for class in c#?
What is the use of functional interface?
What is the lock statement in c#?
Why delegates are type safe?
What is the relationship between a process, application domain, and application?
Tell me the difference between value passing and address passing?
What are the 2 broad classifications of fields in c#?
What are the benefits of using windows services:
What is Garbage Collection in .Net?
Can we override interface methods in c#?
What is arraylist c#?
What is the difference between array and arraylist in c#?