Convert String to GUID that is Compliant with Option Strict

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the the folllowing code that works when Option Strict is Off:

Dim SearchID as string = "2F0B92F1-23E5-4CFA-B8D6-FAFEADE90EBC"
Dim SearchGUID As Guid
SearchGUID = GetConverter(SearchGUID).ConvertFrom(SearchID)

GetConverter is used with the following Imports Object:
Imports System.ComponentModel.TypeDescriptor

Is there a different way to convert a string to a GUID that is compliant
with Option Strict ON?

Thanks.
 
jmhmaine said:
I have the the folllowing code that works when Option Strict is Off:

Dim SearchID as string = "2F0B92F1-23E5-4CFA-B8D6-FAFEADE90EBC"
Dim SearchGUID As Guid
SearchGUID = GetConverter(SearchGUID).ConvertFrom(SearchID)

GetConverter is used with the following Imports Object:
Imports System.ComponentModel.TypeDescriptor

Is there a different way to convert a string to a GUID that is compliant
with Option Strict ON?

\\\
Dim g As New Guid("2F...BC")
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top