Skip to content Skip to sidebar Skip to footer

Unable To Access Database (sql Server Ce / Windows Mobile 6.5)

I'm creating an application for a Windows Mobile 6.5 device, part of which is supposed to replicate a SQL database when the device plugged in, to have a local copy when unplugged (

Solution 1:

Windows Mobile neither knows about drive letters nor a 'current' directory. That is why "Data Source=.\userdb.sdf" will always fail.

On windows mobile you always have to use a full qualified path name to access a file.

You may use

stringpath = System.IO.Path.GetDirectoryName( 
  System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );

to get the path to the directory of where the executable is started.

Post a Comment for "Unable To Access Database (sql Server Ce / Windows Mobile 6.5)"