how can I convert an object type to a GUID type in VB.NET?
I'm not sure what exactly you want but this might help:
Dim g = CType(obj, System.Guid)
If you want to convert a string to a Guid
:
Dim g = New Guid(myString)
If you are looking to create the object as a new guid, use the following call:
dim objvar as guid = System.GUID.NewGuid()
edit Your question is a little unclear when you say "convert". If you already have the object created and assigned, use DirectCast to create an object that the Visual Studio environment will recognize.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With