Print Page | Close Window

How to code GUID as primary key in business object Create method

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=206
Printed Date: 24-Jan-2026 at 9:00am


Topic: How to code GUID as primary key in business object Create method
Posted By: Customer
Subject: How to code GUID as primary key in business object Create method
Date Posted: 12-Jul-2007 at 3:39pm
How do you implement GUID as primary key in business object create method.



Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 3:40pm

Use UDF syntax.  For example:

BusinessObject["Id"] = System.Guid.NewGuid();

Note that indexing is required

BusinessObject.Id = System.Guid.NewGuid();

will normally not work since the "Id" column is usually ReadOnly.




Print Page | Close Window