Farseer,
In addition to the other comments, have you considered using
Convert.ChangeType?
Something like:
Dim table As New Hashtable
Dim name As String = "id"
Dim value As String = "100"
Dim typeName As String = "System.Int32"
Dim conversionType As Type = Type.GetType(typeName)
table.Add(name, Convert.ChangeType(value, conversionType))
name = "code"
value = "Something"
typeName = "System.String"
conversionType = Type.GetType(typeName)
table.Add(name, Convert.ChangeType(value, conversionType))
For Each de As DictionaryEntry In table
Debug.WriteLine(de.Value, de.Key.ToString())
Next
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"farseer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| How can i do this?
|
| i have the following in a config file:
|
| name="id"
| type="int32"
|
| can i create a variable called "id" as type int32?
|