Dynamic Enumerators

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Shafer

    #1

    Dynamic Enumerators

    Is it possible to create dynamic enumerators in Visual
    Basic .Net? For example, an enumurator that provides a
    dropdown of available SQL servers?
  • Jeff Levinson [mcsd.net]

    #2
    Dynamic Enumerators

    An enumerator is a list of values that are part of a type
    and that are called programmaticall y. 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"
    [color=blue]
    >-----Original Message-----
    >Is it possible to create dynamic enumerators in Visual
    >Basic .Net? For example, an enumurator that provides a
    >dropdown of available SQL servers?
    >.
    >[/color]

    Comment

    • Bob Shafer

      #3
      Dynamic Enumerators


      But what I'm wanting to do is have the sql servers drop
      down in design mode like an enumeration. EX:

      objTest.GetData (<Enumerated Servers>,<Enume rated
      DataBases>)
      [color=blue]
      >-----Original Message-----
      >An enumerator is a list of values that are part of a type
      >and that are called programmaticall y. 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"
      >[color=green]
      >>-----Original Message-----
      >>Is it possible to create dynamic enumerators in Visual
      >>Basic .Net? For example, an enumurator that provides a
      >>dropdown of available SQL servers?
      >>.
      >>[/color]
      >.
      >[/color]

      Comment

      Working...