Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is difference between ilist and list?

893


Why singleton pattern is used in c#?

952


Can I use parseint?

881


What is default access modifier for class in c#?

1015


What is the use of functional interface?

910


What is the lock statement in c#?

982


Why delegates are type safe?

908


What is the relationship between a process, application domain, and application?

953


Tell me the difference between value passing and address passing?

1196


What are the 2 broad classifications of fields in c#?

921


What are the benefits of using windows services:

1034


What is Garbage Collection in .Net?

1028


Can we override interface methods in c#?

853


What is arraylist c#?

927


What is the difference between array and arraylist in c#?

1018