SylantBill

I have a PPC application that when I run it and click the Insert button it fills my dataset but does not update the table in my SQL Mobile sdk DB. I am new to programming Mobile Devices so please excuse this newbe question. Here is the code for my insert button. I have been told that I have to attach the sdk DB to the Emulator but I can't find anywhere how to do this. If this is the wrong forum please redirect. Thank you.

Dim SalesmanNum As Integer = 9999

Dim CustomerNum As Integer = 733733

Dim POHeader As String = "abcxyz"

Try

Me.POHeaderTableAdapter.Insert(SalesmanNum, CustomerNum, POHeader)

Catch ex As Exception

MessageBox.Show("Insert failed")

End Try

RefreshDataSet()

End Sub

Private Sub RefreshDataSet()

Me.POHeaderTableAdapter.Fill(Me.SHMobileDataSet.POHeader)

Me.POHeaderTableAdapter.Update(Me.SHMobileDataSet.POHeader)

End Sub



Re: Device Emulator General PPC application does not update sdk database from emulator?

UdayaBG

Hello,

I don't know much about your application, but, this is the way to connect to a db/create a db and connect to it.

Data is in the menu.

Data -> Add new data source.

Cheers,

Udaya





Re: Device Emulator General PPC application does not update sdk database from emulator?

Ilya Tumanov

Keep in mind you're working with a _copy_ of the database on device file system and original on your desktop would never change unless you manually copy it from device to desktop.

Also if you have VS configured to deploy database every time you run your application it would overwrite your changes on device file system.

Finally there's no need for you to call Fill() to save your changes into the database.






Re: Device Emulator General PPC application does not update sdk database from emulator?

SylantBill

Thanks for the replies but I have figured it out. You need to add the .sdf file to your project first. Then map a path to the location of the .sdf file in the emulator so when it opens the program will look at and update the DB on the emulator not on your computer.

Thanks guys.