>>>Hi,
>>>
>>>When adding a new record/row to a table (using CursorAdapter with SQL Server) I have noticed that the cursor does not automatically get the value of the newly created PK. So the PK field value in the cursor is out-of-sync with the table. What is the common practice in this case? Reload the values from the table (that is, calling Fill method of the CA)? or is there a better or more accepted practice?
>>>
>>>TIA.
>>
>>
>>:-)
>>I assume that your PK is integer IDENTITY column?
>>Am I right?
>
>Yes, exactly.
OK,
As Naomi already said, use
InsertCmdRefreshCmd and InsertCmdRefreshFieldList properties of CA
And if you want to see how to use SCOPE_IDENTITY() instead of @@IDENTITY check Message #
1111814
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.