Re: mysqlcommandbuilder and generated commands for update
Posted by: Lou Arnold
Date: September 28, 2006 03:05PM

You have done everything correctly, but you are looking at the Insert commands at the wrong time. The command builder only generates the Insert, Update and Delete Commands as part of the DataAdapetr's Update method. Before that call to Update, the dataset looks like its made up for only the first table.

I would also do the following:
-----------------------------------------
array<DataTable^>^ dta; //temp DataTable array returned by FillSchema
pCpyDA->MissingSchemaAction=System::Data::MissingSchemaAction::Add;
dta=pCpyDA->FillSchema(dataSet1,System::Data::SchemaType::Source, "tblCompany");
dta[0]->Columns[0]->AutoIncrement=true;
int kk; //test - get the number of rows read into the dataset.
kk=pCpyDA->Fill(dataSet1, "tblCompany");//Fill the dataset from the table

pStatusDA->MissingSchemaAction=System::Data::MissingSchemaAction::AddWithKey;
dta=pStatusDA->FillSchema(dataSet1,System::Data::SchemaType::Source,"tblStatus");
dta[0]->Columns[0]->AutoIncrement=true;
kk=pStatusDA->Fill(dataSet1, "tblStatus");//Fill the dataset from the table
-------------------------------
Note that I added the FillSchema command and that I execute that BEFORE the Fill method. After that call I set the Autoincrement property yo true so that auto increments will occur properly.

Options: ReplyQuote


Subject
Written By
Posted
Re: mysqlcommandbuilder and generated commands for update
September 28, 2006 03:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.