Is it possible to convert a SqlCeResultSet into an OleDbDataAdapter / Dataset ?

  • Thread starter Thread starter DavyMac
  • Start date Start date
D

DavyMac

I have a program that has worked for years that would read cdb files
from a pocket PC (iPAQ) and convert them to tables in an Access MDB.
The tables would then be read into a dataset and sent to a SQL Server
via a webservice.

Well, we have finally depleted our stock of iPAQs and are now forced
to upgrade to the newer style using Win Mobile 5 as the OS. WM5 does
not support the older DeviceToDeskTop APIs, so we must now use
SQLServerCE to transfer SDF files. I have been searching and searching
and just cannot figure out how to read tables from the SDF files
located on the CE device as a Dataset to pass to my webservice.

I would appreciate any links or sample code that anyone could provide
that shows me how to do such a task.

Thank you much.

David
 
Database Migration from PocketAcess to SQL CEhttp://msdn2.microsoft.com/en-us/library/ms838154.aspx

In similar boat,

RB

Well, using your link I was able to find out how to do what I needed
to do :)

UNfortunatley it only works when I try it with an sdf file located on
my local PC. I can't seem to get it to work with the same sdf that is
(manually) copied over (via activesync) into the CE device (iPAQ
2495) .

So I figure I am either:
1. Calling/referencing the CE SDF incorrectly
2. unable to do what I am trying to do thus need to programmatically
copy the sdf file over to the desk top before calling my sub.

Here is my sub:

Private Sub moveInvLinFromSDFtoSQL()

Dim MyObj As localhost.Service1 = New localhost.Service1

Dim connection As SqlCeConnection
connection = New SqlCeConnection("Data Source = ""Mobile Device
\MOMS_DB1.sdf""")
'connection = New SqlCeConnection("Data Source =
""\MOMS_DB1.sdf""")
'connection = New SqlCeConnection("Data Source =""C:\Documents
and Settings\dmcafee\My Documents\Visual Studio 2005\Projects
\MOMS_DB1.sdf""")
connection.Open()

Dim sql As String = "SELECT InvLin.* FROM InvLin"
Dim da As New SqlCeDataAdapter(sql, connection)
Dim ds As New DataSet
da.Fill(ds, "InvLin")

Dim RtnMsg As String =
MyObj.InsertInvLin(Me.txtSecureString.Text, ds)
If (RtnMsg <> "InvLin data inserted") Then
'Throw New Exception(RtnMsg)
End If
End Sub
 
Back
Top