Bug #99199 | TableAdapter config Advanced Option "Refresh the datatable" is ignored | ||
---|---|---|---|
Submitted: | 7 Apr 2020 10:51 | Modified: | 15 Jul 2020 20:19 |
Reporter: | oracle oracle | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Visual Studio Integration | Severity: | S3 (Non-critical) |
Version: | 1.2.9 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[7 Apr 2020 10:51]
oracle oracle
[7 Apr 2020 11:39]
oracle oracle
Corrections/errata: In the original submission I said "datasetgenerator" / "data set generator" and by this I mean the device that generates the dataset.xsd XML file. I didn't mean the the "Custom Tool" / MSDataSetGenerator (referenced in the Properties window of a DataSet) that operates on the dataset.xsd to produce compilable .net code ---- The bug appears to be in the tool that generates the XSD/XML file, because if the relevant query is manually patched into the XML, then the Custom Tool/MSDataSetGenerator correctly generates adapter queries that select the appropriate updated data from the DB
[7 Apr 2020 12:07]
oracle oracle
Extra info: This bug is probably related to bugs #70305, #37865 and #23082. Particularly with #70305 I think it's the same bug but I'm reporting it at an earlier moment in the process of : 1) developer creates dataset, 2 ) mysql/vs creates dataset xml XML, 3) msdatasetgenerator turns XML into code, 4) developer uses code The other bugs are focusing on the symptoms of the bug they are encountering in step 4) stage, whereas I believe these other bugs are actually occurring because earlier in the timeline, the XML was generated incorrectly at step 2. If this #99199 is to be closed as a duplciate, please link earlier bugs to it to make the workaround of manually including the same SQL as "refresh the datatable" performs available as an option for people landing on those earlier bugs
[15 Jul 2020 20:19]
MySQL Verification Team
Duplicate of bug https://bugs.mysql.com/bug.php?id=70305.
[2 Jan 2021 20:00]
Maciej Kosior
WORKAROUND - runtime Modify insert command before using the tableadapter or connection: Me.<name>TableAdapter.Adapter.InsertCommand.CommandText = Me.<name>TableAdapter.Adapter.InsertCommand.CommandText & ";SELECT <field_id>, <...>, <...>, <...>, <...> FROM <tablename> WHERE <field_id> = last_insert_id()" The record gets auto-updated with DB generated values. MySQL team - pls repair the problem, it's as easy as above. You only have to identify DB Server side columns (autoincrement or virtual/calculation) and add proper SELECT command to the INSERT/UPDATE command.