How to convert Guid to string and String to Guid..?
hi, could anyone post some example codes for conversion between GUID and String and also conversion string to GUID..?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jul 23, 2012, 5:12 AM
For details, check these links:
http://msdn.microsoft.com/en-us/library/96ff78dc.aspx
http://msdn.microsoft.com/en-us/library/97af8hh4.aspx
osama handoumehPosted Jul 23, 2012, 4:57 AM
string s ;
Guid g = Guid.NewGuid();
s= g.ToString();
//////
from string to guid :
g= new Guid(s);
but the string must be in the same format as Guid (00000000-0000-0000-0000-000000000000)