To get auto incremented value updated in the datatable after used tableadapter. But when I check it, then close all dialogs (OK, Terminate) and reopen the dialog, the checkbox is not checked anymore. The option to configure the tableadapters to refresh after inserting doesn't seem to do anything.
So, I think the bug is not in the Table Adapter runtime code, but in the Table Adapter design time. I've struggled many times with this bug, and I can confirm that it is present in 6.0.3 as well. I'm using VS2008, Windows XP, My SQL Connector/NET 6.0.3.
Basically, Db Command Builder will call Initialize Command with a null parameter when the commands are being generated.
If that parameter is null, then I assume we are generating new commands.
But I think the simple explanation is in the "Advanced option" of the Table Adapter configuration dialog.
The third checkbox "Actualiser les données" (Update data after Insert or Update) is not remembered. First Returned Record End Sub Bit of a hack, but as long as I fix the tableadapters this way, they do function correctly.
Connector/Net 1.0 had some syntax for this but starting with Connector/Net 5.0 that all changed. Net 2.0 API, Microsoft did not directly provide for any type of API that users could use for selecting this. Second, the command object must have its Updated Row Source property set to Both or First Returned Record.
Command builder objects usually provide some type of syntax where a user can indicate that they want this to be done. First, a SELECT statement similar to above must be attached to the INSERT command.
I'm new to winforms and telerik controls but I'm almost embarressed to write this. But those insert/updates are not committed to the database. In general, you may find more resources in our documentation which can be accessed online.
The problem is that the base class Db Command Builder doesn't expose the command building mechanism as virtual so you can't hook into it. Also, the table adapter config wizard is hard coded to only add a final select when dealing with Sql Server.