|
| Convert from String to GUID |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.general.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| TK Herman |
In code I have a String and I want to convert that to a GUID -- is this possible? How?
SAMPLE: Dim strValue as String Dim objGUID as System.GUID
strValue = "{80E9CEF7-1C93-48A7-866C-2002F94379E6}" objGUID = strValue 'Obviously this doesn't work...
(Note: My GUID is a valid GUID -- I copied one for this sample that SQL Server automatically created...)
-- Thanks in advance for any help you can provide.
TK Herman tk.herman_AT_ensi.com
|
|
|
| |
|
| |
| |
| Thomas Tomiczek (VIP) |
Simple, look at the constructors... My logic in C#:
String strValue; Guid objGUID;
strValue = "{80E9CEF7-1C93-48A7-866C-2002F94379E6}"; objGUID = new Guid(strValue);
Regards -- Thomas Tomiczek THONA Consulting Ltd. (Microsoft MVP C#/.NET)
"TK Herman" <Click here to reveal e-mail address> wrote in message news:#$yFDGagBHA.1640@tkmsftngp05... [Original message clipped]
|
|
|
| |
|
|
| |
| | |
|
| |
| Lee Johnson [MS] |
You can use the Guid constructor to construct a GUID from string.
Guid g = new Guid("{80E9CEF7-1C93-48A7-866C-2002F94379E6}");
--------------------- This posting is provided ¡°AS IS¡± with no warranties, and confers no rights.
|
|
|
| |
|
| |
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|