Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with generic
Message
From
18/07/2007 11:28:43
 
 
To
18/07/2007 10:49:12
Victor Acosta
Independent Programmer.
San José, Costa Rica
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01241343
Message ID:
01241570
Views:
31
Hi,

>I can not create a Conditional as a CASE, IF or similar because, YES, I have 600 different objects, each table of my system represents a new object.

>Now to make life easier, I am creating a web control that allows to navigate through the data (move first, move last, delete, new, etc).
>
>
>I need to recover the object from the session in the web control:
>
>
>Xtype myLOCALcollection;
>myLOCALcollection = (Xtype) Session["coleccion"];
>
>
>Here you can see my trouble, I don’t know at compile time, what is the type of the local collection, say, the current collection.
>
>In few words, I need to create the type Xtype at run-time and BASED on the type of the object that is saved into the session var.

I thought you just wanted to obtain a correctly cast reference to the stored session object - not create an instance of it?

Anyway I, like Martin, beleive that you have a design problem. I understand what you are trying to do but not what you intend doing thereafter. Unless your various objects exhibit a common behaviour how will any subsequent code handle them? Could you provide them all with a common interface and cast to that?

Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform