docs icon indicating copy to clipboard operation
docs copied to clipboard

This example is incomplete

Open Bunny2000 opened this issue 8 years ago • 3 comments

The final step of how to add records to the orders table related to each customer record is missing. Obviously in this example we know the customer id and can simply call the add method on the orders table and add a row. But if the primary key was an int32 with auto increment set true how can i find the value of this key so i can add records to the child table?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Bunny2000 avatar May 20 '18 07:05 Bunny2000

@Bunny2000 Do you have code already in place where you can test this easily? Check the value of workRow[0] (assuming the primary key is the first column) or workRow[<identity_column_name>] after the Rows.Add call.

douglaslMS avatar May 20 '18 16:05 douglaslMS

#in-progress

douglaslMS avatar May 20 '18 16:05 douglaslMS

Thanks works a treat

On 21 May 2018 2:07:10 am ACST, Douglas Laudenschlager [email protected] wrote:

@Bunny2000 Do you have code already in place where you can test this easily? Check the value of workRow[0] (assuming the primary key is the first column) or workRow[<identity_column_name>] after the Rows.Add call.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dotnet/docs/issues/5488#issuecomment-390494643

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

Bunny2000 avatar May 23 '18 07:05 Bunny2000