O
Ola Fjelddahl
hejdig.
Have anybody had any success with implementing TableAdapters together with
tables with an int PK that is set by the database?
The problem is that when the row is inserted into the dataset's datatable,
it is set to a value automagically. When the row then is persisted into the
database's table it is set to another value. This new value is not
communicated to the dataset (at least I havn't found it)
I have come up with threee solutions so far:
1) Exchange the int PK in favour of a GUID PK and create it in the
application.
2) Loop through the datatable when updating and figure out how to handle
each row by itself.
3) Always start with inserting the new row and figure out how to find the
"last row inserted".
BTW: The database is a SQLServerCE3 for a PocketPC2005 but I am interested
also in solutions for SQLServer2k.
TIA
/OF
Have anybody had any success with implementing TableAdapters together with
tables with an int PK that is set by the database?
The problem is that when the row is inserted into the dataset's datatable,
it is set to a value automagically. When the row then is persisted into the
database's table it is set to another value. This new value is not
communicated to the dataset (at least I havn't found it)
I have come up with threee solutions so far:
1) Exchange the int PK in favour of a GUID PK and create it in the
application.
2) Loop through the datatable when updating and figure out how to handle
each row by itself.
3) Always start with inserting the new row and figure out how to find the
"last row inserted".
BTW: The database is a SQLServerCE3 for a PocketPC2005 but I am interested
also in solutions for SQLServer2k.
TIA
/OF