From: LightStamp on
Posted this in WindowsCE App Dev too....

I've got a tableadapter that I set the sql with:

DataAdapter = New SqlCeDataAdapter(String.Format("SELECT IdDtl, IdInvc,
IdStore, IdBarCode FROM DetailsTable WHERE IdInvc = '{0}'", IDInvoice),
SqlConnection)

DataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
CommandBuilder = New SqlCeCommandBuilder(DataAdapter)
DataAdapter.UpdateCommand = CommandBuilder.GetUpdateCommand()
DataAdapter.InsertCommand = CommandBuilder.GetInsertCommand()
DataAdapter.DeleteCommand = CommandBuilder.GetDeleteCommand()

This gives me all the data to populate my smartgrid with details for a given
Invoice number.

DataAdapter.Update(Rs.Table) handles inserted detail rows, deleted detail
rows just fine. But if I try to update a particular cell in a particular
row, the update always fails. I know the data adapter is supposed to "read"
each row on update and decide whether or not that row has changed and if so
perform the update. But UpdateCommand never runs and the database data
never gets updated.

DataAdapter.InsertCommand = CommandBuilder.GetInsertCommand()
DataAdapter.DeleteCommand = CommandBuilder.GetDeleteCommand()

Run just fine.

How do I debug this?? Hitting an SDF database on the device during debug
runs.

TIA

Harry


 | 
Pages: 1
Prev: Forum?
Next: XmlDocument and SelectSingleNode