Dynamic Enumerators

  • Thread starter Thread starter Bob Shafer
  • Start date Start date
B

Bob Shafer

Is it possible to create dynamic enumerators in Visual
Basic .Net? For example, an enumurator that provides a
dropdown of available SQL servers?
 
An enumerator is a list of values that are part of a type
and that are called programmatically. A list of available
sql servers are just text values in a combo box.

So, knowing that I'm not quite sure what you're asking.
In terms of actually creating an enumerator on the fly,
you wouldn't want to because it serves no purpose.

To give you an idea, here is the typically scenario for
an enumerator:

public enum eCars
GM = 0
Ford = 1
end enum

public sub Test(e as eCars)
select case e
case eCars.GM
...
case eCars.Ford
...
end select
end sub

So, you can see that using a dynamic enumerator is not
really practical.

Jeff Levinson

Author of "Building Client/Server Applications with
VB.NET: An Example Driven Approach"
 
But what I'm wanting to do is have the sql servers drop
down in design mode like an enumeration. EX:
 
Back
Top