How to generate new GUID
GUID is globally unique identifier. Guid class in .net contains a static method NewGuid. Use it. Formats are given bleow.
| System.GUID.NewGuid().ToString() | 32 digits separated by hyphens 00000000-0000-0000-0000-000000000000 |
| System.GUID.NewGuid().ToString("B") | 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000} |
| System.GUID.NewGuid().ToString("P") | 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000) |
| System.GUID.NewGuid().ToString("N") | 32 digits: 00000000000000000000000000000000 |
| System.GUID.NewGuid().ToString("X") | Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces: {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} |
| System.GUID.NewGuid().ToString("D") | 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000 |