AXH,
It sounds like you want to use Convert.ChangeType.
| dim regvalue as string= "123456"
dim regtype as string = "System.String"
|
| private function GetValue as object
Return Convert.ChangeType(regvalue, Type.GetType(regtype))
| end function
NOTE: regtype needs to be one of the types listed in System.TypeCode,
qualified with its namespace (such as System.String & System.Int32)
Alternatively you could simply use the overload that accepted
System.TypeCode or use GetType(String) & GetType(Integer)...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"AXH" <ax*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
| Hi All,
|
| I have to following problem.
| Is it possible type convert a stringvalue to a type value.
| Please look below for the example
|
|
| dim regvalue as string= "123456"
| dim regtype as string = "String"
|
| private function GetValue as object
| return ctype(regvalue,?????????)
| end function
|
| Thanks,
| AXH
|
|