none
Accessing remote database(in Windows Embedded Compact7) from PC RRS feed

  • Question

  • I am able share a folder of Windows Compact 7& access it from PC.
    We've got an SQL CE database on a remote machine(ICOP PMX-090T-8A with Windows Compact 7) and we're trying to get a reporting system
    via c# application to connect to the database in shared read mode.
     
    At this point we're getting an exception "File Path is not valid", 
    even when the database has no other connections. Our sql connection string appears thus:
    using (SqlCeConnection conn = new SqlCeConnection( "Data Source=\\wince\\HDD\\Packi.sdf; File Mode=shared read;"))
            {
                conn.Open( ); // => exception here
               ...
             }
    We want to know is this is even possible?

    If I map a drive(Z:) to share folder then able to access database through SqlCeConnection & respective Data Source Path but

    Is there any other option to access SQL CE database remotely without mapping shared folder to a drive(Z:).??

    Wednesday, August 27, 2014 4:44 AM

All replies

  • I take that you are trying to connect the database on the Compact 7 system from a desktop via a share.

    I'd suggest that is not the way to go as SQLCE is not meant to be shared as such.

    It probably is better to pass the file between systems.

    Better still look at Merge replication and Sync Services which are really the way to share data across systems with SQLCE.

    PS Don't get confused with SQL Compact 4.0+ as that's only for desktop.

    Compact 7 uses SQLCompact 3.7

    Wednesday, August 27, 2014 1:14 PM
  • Shared read definitely won't work with SQL Compact. If you are the only client of the file, I'm not aware of any restriction preventing you from opening it over the network. Your C# coding is wrong causing your current problem.

    You want:

    \\wince\HDD\Packi.sdf

    What you've actually put is:

    \wince\HDD\Packi.sdf

    You need two double backslashes at the start of your connection string path:

    "Data Source=\\\\wince\\HDD\\Packi.sdf; File Mode=shared read;"

    Paul T.

    Friday, August 29, 2014 3:45 PM