Re: How to read data from stand alone SQL CE database on mobile device from VB.net 2005



Have you considered using Rapi to copy the sdf file from the device to the
desktop, then process the data on the desktop? (You will need the SQL
Compact Edition CTP if the desktop is not a development machine.) You can
also use Rapi to delete the file on the device when you're finished with it.
There is a Rapi wrapper on www.opennetcf.org. There is also a 3rd party
product at www.primeworks.pt that may do what you want.

--
Ginny Caughey
Device Application Development MVP


"Dikbill" <dikbill666@xxxxxxxxxxx> wrote in message
news:455c49c8$0$9463$ba620dc5@xxxxxxxxxxxxxxxxxxxxxx
Hi there,

I have a stand alone SQL CE database on my windows mobile device.
OS = WM 5 Dutch.
I can alter teh local database on the mobile device which will be used
by persons who will store data when they visit a client.

When they come back to the office, where no SQL server is available,
I want to read the SQL CE data from their mobile device.
After their new data is processed in the VB.net application I will
delete the data ont heir mobile device.

The database will be very simple.

The problem is that I can't get a connection with the SQL CE database
from the VB.net application.

This is my code:

Dim conn As New SqlCeConnection("Data Source=\My
Documents\AppDatabase1.sdf")

conn.Open()

Dim cmdView As SqlCeCommand = conn.CreateCommand

cmdView.CommandText = "SELECT * FROM TESTTABEL"

Dim da As New SqlCeDataAdapter(cmdView)

Dim ds As New Data.DataSet

da.Fill(ds, "Test")

DataGrid1.DataSource = ds.Tables(0)

conn.Close()

The VB.net can't find the database but it is there.



Anyone?



Dikbill
The Netherlands




.