lbargers
asked on
How to iterate through enumeration in VB.net
Hi,
I would like to iterate through an enumeration and capture the names and coresponding values. The problem I am running into, is when I attempt to capture the enumeration type using the following line:
Dim mytype As Type = Type.GetType("Bold.Provide rs.CRMData Provider.C aseViews")
the type is "Nothing". Am I not correctly qualifying the namespace where my enumeration exists?
I would like to iterate through an enumeration and capture the names and coresponding values. The problem I am running into, is when I attempt to capture the enumeration type using the following line:
Dim mytype As Type = Type.GetType("Bold.Provide
the type is "Nothing". Am I not correctly qualifying the namespace where my enumeration exists?
Dim mytype As Type = Type.GetType("Providers.CRMDataProvider.CaseViews")
Dim names() As String = [Enum].GetNames(Type.GetType("Bold.Providers.CRMDataProvider.CaseViews"))
Dim vals As Array = [Enum].GetValues(Type.GetType("Bold.Providers.CRMDataProvider.CaseViews"))
For Each Name As String In names
Debug.Print(Name)
Next
For Each value As Object In vals
Debug.Print(value)
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.