J
j.fitchett
Platform: Visual Studio 2005, c#, target smart device, Pocket PC
Problem: .update method does not store data to database.
Background:
1. created a database on pocket pc with sql CE query analyzer.
2. created app with datagrid, mapped auto-generated dataset and
databindings to this database.
3. Populated the database by sql analyzer with 2 records so I could
insure app is using right DB
4. call fill to get initial data, notice grid shows 2 records as
expected.
this.invoicesTableAdapter.Fill(this.comcashDataSet.Invoices);
5. Hit button to add new records, using dataset.addrow()
comcashDataSet.Invoices.AddInvoicesRow(scurinv, cname, p[x].plu,
p[x].desc, p[x].price, ftax, "O");
comcashDataSet.Invoices.AcceptChanges();
6. When done adding items, call update to post them ( I thought! )
resultcode = this.invoicesTableAdapter.Update(comcashDataSet.
Invoices);
*** Note result code returns 0 ***
7. Then reread the database to see if changes took
invoicesTableAdapter.Fill(comcashDataSet.Invoices);
results in back to only 2 records, browsing table shows 2 records,
nothing I do seems to make the data stay past the current session.
what am I missing?
Problem: .update method does not store data to database.
Background:
1. created a database on pocket pc with sql CE query analyzer.
2. created app with datagrid, mapped auto-generated dataset and
databindings to this database.
3. Populated the database by sql analyzer with 2 records so I could
insure app is using right DB
4. call fill to get initial data, notice grid shows 2 records as
expected.
this.invoicesTableAdapter.Fill(this.comcashDataSet.Invoices);
5. Hit button to add new records, using dataset.addrow()
comcashDataSet.Invoices.AddInvoicesRow(scurinv, cname, p[x].plu,
p[x].desc, p[x].price, ftax, "O");
comcashDataSet.Invoices.AcceptChanges();
6. When done adding items, call update to post them ( I thought! )
resultcode = this.invoicesTableAdapter.Update(comcashDataSet.
Invoices);
*** Note result code returns 0 ***
7. Then reread the database to see if changes took
invoicesTableAdapter.Fill(comcashDataSet.Invoices);
results in back to only 2 records, browsing table shows 2 records,
nothing I do seems to make the data stay past the current session.
what am I missing?