Moving data from SQL Server to SQL Server CE and DataSet states

G

Guest

hi,

I'm using WebServices to move data from my SQL Server to SQL Server CE
sitting on my PocketPC. The first time I use the DataSet to move a record in
any direction all is well. However, I receive duplicate key errors when I try
update a record that is already in the either database. This would be due to
when I fill the DataSet the records are marked as New and so when I do an
Update() initially all is well. On subsequent times the Insert command is
fired when I really want to do an Update.

If I wasn't storing the data in SQL Server CE then the DataSet would
maintain its state. However, I just use the DataSet as a transport mechanism.

Is it most likely that I am going to have to write some custom code to
handle the Insert/Update/Delete functionality or is there some way the
DataSet can help me?

regards,
Ralph
 
G

Guest

Hi Ralph,

I had a similar problem. I solved this by adding my own RowState column to
all my tables and handling the value (added/modified....) myself. That is the
webservice makes an update if rowstate=modified and so on...

HTH,
Sitar.

___
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top