I'm on the run, so don't have time for a better answer right now:
I've seen code where the disconnected table has the "ID" field defined as
autonumber(-1,-1) even though it's defined as autonumber(1,1) in the
database. This way, while disconnected, you'll get ID numbers in a totally
different range from the real ones in the database.
These will be ignored when you update to the database, and replaced with the
real, positive ID numbers.
There is some trick I'll need to look up, which reads back the "final" ID
values after the update is done to the database, and updates the in-memory
table with the "real" value. Apparently, it can also update any related
in-memory tables as well. I'll try to dig that up for you, but it may take a
day or so.
--
John Saunders
johnwsaundersiii at hotmail
"Wance" <Wa***@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
John,
Thank for your response, but I am still confused how to work with
disconected data. I 've created disconected dataset and table. Then I
create DataGrid to display data that added in form. If finish add data, I want to
send data to table in SQL Server database. My Table in SQL Server have
automatic number field. Say it "GatepassID", but in my disconected table I
don't give the "gatepassID" value, cause it will generate by SQL Server
when I update data from disconected table to table in SQL Server.
I want after user add data into disconected table and store into SQL Table
they will get new number ("gatepassID") generated by SQL so the data will
always consistence.
how method should I make?
Thank and Regards
wawan