Hi, everybody.
let we post the example to understand the problem:
I have 2 tables:
Person: (PersonID, PersonName, ...)
Phone: (PhoneID, PhoneNumber, PersonID) where PersonID is a foreign key.
based on the MSDN sample, I create a form to enter informations about persons with its phone numbers using the datagridview.
I have in my form:
textboxs to enter person informations and datagridview to enter the phones numbers.
PersonBindingSource
PersonBindingNavigator
PersonTableAdapter
PhoneTableAdapter
Phones_Persons_BindingSource (created Manually having PersonBindingSource as datasource, and FK_Phone_Person as datamember)
Normally I bind the navigator to PersonBindingSource, and the datagridview to Phones_Persons_BindingSource.
I got this method from creating Master_Detail form in MSDN.
this form works properly while one user use it. but when 2 user try to open this forms, no exceptions occured, but the phone number enterd by the second user will be joind to the phone number of the first user.
when the first user open the form and add new person:
automatically the Primary key PersonID will be 1 for example.
and if the second user open the form and add new person before that the first user save the new user, so the Primary key PersonID will be also = 1.
so any phone number entered in the datagridview will have 1 as personID (ForeignKey).
when saving, the user who precede will have the Primary key PersonID =1 and the other will be automatically changed to 2 . but the foreignkey PersonID will still=1. and so, the 2 number will be related to the first person that having the primary key = 1.
I hope that I explain the problem, but is there any way to catch the created primary key when saving (the real one) .
Thanks...

Multiuser problems!! need helps
cronic76
hi,
you can read those 2 articales
concurrency of multiuser editing db >>> http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpguide/html/cpconOptimisticConcurrency.asp
handling concurrency >>>> http://msdn2.microsoft.com/en-us/library/ms171936.aspx
hope this helps
Larry Blake
hi,
i'm not sure how to solve this but you can add the new rows that have been added to your dataset programaticly, and add every field to the database but exclude the keys fields and let the database to add them for u but this solution will take much time to write the code
hope this will help
Palcouk
you can simulate the multiuser fonctionality by running 2 instance of the same form or application.
Thanks...