Solved

Connect to sdf file on pocket pc

Posted on 2008-06-17
6
1,925 Views
Last Modified: 2013-12-05
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)
        SqlConn.Open()
        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
        SqlConn.Close()


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)
0
Comment
Question by:wiswalld
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 500 total points
ID: 21802765
hi there,

as far as I know you can't do it in that direction (PC->PDA) while from PDA to PC you can use RDA.

Nevertheless, you can use RAPI (either direct wrappers or e.g. OpenNETCF.Desktop.Communication classes) to
(1) copy sdf file from PDA to desktop or
(2) from desktop application, execute a method int C++ dll resided on PDA (which you need to develop) via CeRapiInvoke() - this dll may execute all you want to as it is running on the device

If anyone knows better solutions I'd be glad to know
0
 
LVL 13

Author Comment

by:wiswalld
ID: 21802941
You are really shooting me down. I thought a simple connection string like this would work

Imports System.Data.SqlServerCe

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim connection As SqlCeConnection
        connection = New SqlCeConnection("Data Source=\MyDatabase.sdf")
        connection.Open()
    End Sub
End Class
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 21803011
as you can see e.g. here (http://msdn.microsoft.com/en-us/library/aa226134(SQL.80).aspx) it is for Compact Framework. Your code will work perfectly well on Windows Mobile, but not from desktop to PDA

or I completely misunderstood you?
0
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
LVL 13

Author Comment

by:wiswalld
ID: 21803099
No I think you got me. I want to connect to an sdf file on a mobile device and copy table data to an sdf file on a desktop. I want to create an application using an sdf file to avoid having to have clients use sql server. So I wanted to create a desktop windows application with a button that will open the connection to the pocket pc and copy records to the desktop sdf file.
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 21803147
thus that's no way to do it (I hope I am wrong :) , but it seems to be just hard fact)

but you still can employ the 2nd solution I mentioned, that is, using RAPI and C++ dll on PDA which your desktop app can talk to
0
 
LVL 13

Author Comment

by:wiswalld
ID: 21805448
I am not using C++. I was hoping to use vb.net. Can this work the other way. A sync button the pocket pc to connect to the desktop
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question