The problem here Bill is two fold:

1. Easily solved non duplicate primary key by either using a GUID column or
an identity column. The nice thing about a guid column is the client can
create the value and know the insert won't create a duplicate primary key.

2. Here's the more complex problem - can you be sure that A and B won't add
the same customer, thus creating two database records for the same business
entity. This is a problem domain specific issue and not one that can be
solved with a simple general solution.

Regards

Richard Blewett
DevelopMentor

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Bill Bassler
Sent: 04 February 2004 14:46
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] Ensuring unique keys from multiple DataSets when
updating

I'm designing an application that has a server running a webservice that
supplies a dataset through one method, and accepts changes through another.
The dataset supplied has a primary key on the only one table it contains.
Now, two clients, "A" and "B", request the dataset, here is how their table
looks (Identical).

CustomerID          FirstName
1                   Alpha
2                   Beta

Both “A” and “B” add a row. Since the primary key generated by the datasets
could be identical or irrelevant, how do I ensure that the database
generates a consistent primary key?

===================================
This list is hosted by DevelopMentor®  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 30/01/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 30/01/2004
 

===================================
This list is hosted by DevelopMentor®  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to