Administrator
VB.NET Forum Admin
- Joined
- Jun 3, 2004
- Messages
- 1,462
- Programming Experience
- 10+
I want to use a custom enum of type Integer with set values to each enum specified. For example, I have the following Enum in a referenced DLL the web service uses:
But when the Reference.vb is created, it's not of specific type Integer and therefore the values get messed up as they are numbered 0, 1, in order:
How do you create an Enum for use with web services that will retain the exact Integer assignments?
VB.NET:
<Serializable()> _
Public Enum enuCommandType As Integer
Text = 1
StoredProcedure = 4
End Enum
But when the Reference.vb is created, it's not of specific type Integer and therefore the values get messed up as they are numbered 0, 1, in order:
VB.NET:
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.312"), _
System.SerializableAttribute(), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://xxxxxxxxxxxxxxxxDELETEDXXXXXX/")> _
Public Enum enuCommandType
'''<remarks/>
Text
'''<remarks/>
StoredProcedure
End Enum
How do you create an Enum for use with web services that will retain the exact Integer assignments?