How do I convert a string to a GUID?

To convert a string to a GUID, do the following:

In C#:

Guid MyGuid = new Guid(stringValue);

And in VB .NET:

Dim MyGuid As Guid = New Guid(stringValue)

© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 11/09/10
Comment or report problem with topic