Connect to sdf file on pocket pc
Posted on 2008-06-17
I simply want to connect to an sdf file on a pocket pc with a connection string from a desktop application. I think this should be simple. Then select all records from a table and copy to an sdf file on the desktop. I have looked into rda and other solutions but they seem to confusing. There has to be an easier way.
What about a connection string like this
Dim SqlConn As SqlCeConnection
Dim DataPath As String
DataPath = "\DVADGolf.sdf"
SqlConn = New SqlCeConnection("Data Source=" & DataPath)
Dim DA As SqlCeDataAdapter
DA = New SqlCeDataAdapter
Dim Str_Sql As String
Str_Sql = "Select * from tblplayer"
Dim CmdSelect As SqlCeCommand
CmdSelect = New SqlCeCommand(Str_Sql, SqlConn)
DA.SelectCommand = CmdSelect
Dim DS As DataSet
DS = New DataSet
I will not need the bottom part. I just copied some code I found. I will need to add an update statement or insert (I think)