Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i am trying to make connection of sqlce3.5 database to window moble6.0 application, but it show the the Error "Path is not correct ",

i have added the System.Data.Sqlce; name space also but still not working,

my database path is " C:\Users\SHAMS\Documents\App.sdf"
when i give this in connection string then it show the error the database path is not corect.


please help me
if u can


many thanks in advance

u can contact me on this id
shams_afridi2002@yahoo.com
Posted

1 solution

Hi,

In mobile device application development, the path is always relative to "Mobile Device" root("Mobile Device" option appears only if you are connected to device or emulator using ActiveSync) instead of C drive. As when at runtime the application is launched using either emulator or device which use "\" as the root path. Emulator or device does not know what is "C:". ;)

Keep your sdf file in side "\" ( which is also called "My Mobile Based Device" then provide the path of sdf.

Example: If your sdf file location is like following :

Inside My Computer --> Mobile Device -->My Windows Mobile Based Device --> <your folder="" name="">\YourSdfFile.sdf

Then in application give the path this way "\<Your Folder Name>\YourSdfFile.sdf"

String sConnString = @"\MyFolder\sample.sdf"



NB: In My computer explorer "Mobile Device" option appears only if you are connected to device or emulator using ActiveSync.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900