Bug #70305 TableAdapter wizard advanced options Refresh the data table not working
Submitted: 11 Sep 2013 21:27 Modified: 21 Jan 2015 0:54
Reporter: jay patel Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Visual Studio Integration Severity:S3 (Non-critical)
Version:6.7.4 OS:Windows (win 7 )
Assigned to: Assigned Account CPU Architecture:Any

[11 Sep 2013 21:27] jay patel
Description:

First forgive me i am new to MYSQL I am converting a project from MSSQL. IN MSSQL when you add a new table adapter the "refresh the data table" is default checked. This lead me to think it not being checked is causing this bug.

The reason i want to do this is so after an update to the database in my code i can get the new auto generated index. Here's some code.

dsJob.jobtblRow[] JobRows = (dsJob.jobtblRow[])m_dtJobs.Select("ID = " + lID);

foreach (dsJob.jobtblRow JobRow in JobRows)
{
  fProgress.UpdateProgressBox("", "Saving Job Data...");
                  
  lOldJobID = JobRow.ID; //saving the old ID 
  JobRow.EndEdit(); //make sure not editing
  m_taJobs.Update(JobRow); //update the table adapter
  JobRow.AcceptChanges(); //accept the changes
  lNewJobID = JobRow.ID; //get the new auto incremented ID
}

 Using MSSQL after the AcceptChanges the JobRow.ID get updated to the new auto generated one. But in MySQL its still -1.

Am I doing something wrong or is there a work around?

How to repeat:
 have a MySQL database ready. World default will work.
 - Open VS 2010 and create a new Visual C# Windows Form Application project.
 - Add a new DataSet to the project.
 - Using the Server Explorer right click data connections and add connections...
 - select MySQL database.
 - Fill in server name, user id, password and database name(World). Check "Save my password" and click OK.
 - Expand the server in server explorer.
 - expand the database(World)
 - drag adn drop any of the tables to the dataset.
 - right click on the datatable and select configure..
 - click on the advanced options
 - check refresh the data table
 - ckick ok.
 - click finish.
 - reopen it and go to the advanced options - not checked
[15 Jul 2020 20:20] MySQL Verification Team
https://bugs.mysql.com/bug.php?id=99199 marked as duplicate of this one.