Click here to Skip to main content
16,019,349 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,..
I got The following Error,
The Actual Error is

Error:The database file cannot be found. Check the path to the database. [ Data Source = \Program Files\database\sample3.sdf ]

I used VS 2008 sp1, SQL Server 2008 and Windows Mobile 6.0 for developing Windows Mobile Application.I got the Above Error.It is correctly Working in(View->ServerExplorer->Add Connection) but I did disconnected approach.i got the error and so i copied my application(database)and db(sample3.sdf)into the (C:\Program Files)i got the error..Please give me the correct solution for my problem..Thx
Posted
Updated 19-May-11 20:27pm
v3
Comments
ZeeroC00l 19-May-11 8:36am    
If the db file is in C:\Program Files why does the source contain \Program Files\database\ in the path ?
ZeeroC00l 19-May-11 8:36am    
--edited for readability

1 solution

Check the database exists, and that you have indeed pot it in the right place. (You should not really keep datafiles under the "Program Files" folder - consider "My Documents" instead).

In Visual studio, open the Server Explorer pane (View..Server Explorer)
If your database is listed, then it's location will be in the "Connection string" parameter in the Parameters pane if you highlight it.

If it isn't listed, right click Data Connections, then click Add New Connection and browse to it. You can check it is there and working from this dialog.
 
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