Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Typeof
Message
From
02/12/2004 15:58:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Other
Title:
Re: Typeof
Miscellaneous
Thread ID:
00966347
Message ID:
00966506
Views:
6
>if have an Arraylist filled with structs and the struct is:
>
>public struct myTables
>{
>   Type DsType; // Contains the System.Type of the strongly typed dataset
>   DataSet Data; // Contains the dataset
>}
>
>// the code that fills the list
>this.List.Add( new MyTables(typeof(MyTable1), MyTable1) );
>
>
>Now i want to get a dataset from this arraylist and cast it to it's base type, how would i do that.

Stephane,
What's the question?
How to retrieve from ArrayList? AFAIK ArrayList is not very much suitable for it, you'd need to know or check which one you wnat looping. Check SortedList where you can put it in key-object pairs and retrieve with a key.
I assume question is not how to cast as it's already a DataSet.
PS: Why such a struct? Something like this would do IMHO (what IDE generates or xsd.exe):

public class myData: DataSet {}

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform