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



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


.


Loading