Hi folks,
I am working on a distributed VB.NET/SQL2K db application that needs the ability to work independently of the database for a time, creating and modifying orders.
While the connection is down, we are assigning GUIDs to every object the user creates (customers, orders, line items, etc.) rather than using conventional auto increment integers. We use System.Guid.NewGuid.ToString to do it. On the client, we manage the relationship with collections, ie. the order class has a collection of lineitems objects, etc.
The db records on the server use regular auto incrementing integers. Therefore, when they synchronize, we are getting the ID numbers and assigning them to the remotely created orders. (This gets a little hairy for parent/child relationships, but it is manageable with enough FOR EACH loops).
There is, of course, another option: we could just keep the GUIDs that we generate on the client and store them as our primary keys in the DB. Does anyone have any comments on using GUIDs instead of integer primary keys? Is this a good idea/bad idea?
Thanks in advance.
Brian