1: // Uses the built in function to return a guid
2: private Guid _globalId = Guid.NewGuid();
1: // Goes to the database, uses select newid() from a sproc to return a new guid
2: private Guid _globalId = LicenseVerification.ClientAccessLicenseBusiness.CreateGuid();
1: using System;
2: using System.Collections.Generic;
3: using System.Text;
4:
5: namespace LicenseVerification
6: {
7: public class ClientAccessLicenseBusiness
8: {
9: //...snip...
10:
11: public static Guid CreateGuid()
12: {
13: return LicenseData.CreateGuid();
14: }
15:
16: //...snip...
17: }
18:
19: public class LicenseData
20: {
21: //...snip...
22:
23: public static Guid CreateGuid()
24: {
25: Guid newGuid = (Guid)SQLHelper.ExecuteScalar(DataConfig.ConnectionString, CommandType.StoredProcedure, "ClientAccessList_CreateGuid");
26: return newGuid;
27: }
28:
29: //...snip...
30: }
31: }
1: CREATE PROC [dbo].[ClientAccessList_CreateGuid]
2: AS
3: select newid()
Yes, you are seeing this correctly! The programmer who wrote this thought that going thru the business & data layer to call a stored procedure would be the best way to create a new Guid. I'm in complete shock.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u