Click here to Skip to main content
13,591,625 members
Rate this:
 
Please Sign up or sign in to vote.
I have been having trouble with a Database Table, in that I was updating it, yet when I looked in the ComboBox, the update wasn't showing up.

I have been told that it is probably because my Database was set to "Copy if Newer", so I have amended it to "Do Not Copy" but I am now getting a Build Error as follows ...

The database file cannot be found. Check the path to the database. [ Data Source = j:\Users\Gary\Documents\Visual Studio 2010\Projects\KA League Cup\KA League Cup\bin\Debug\KALC.sdf ]


The message isn't wrong, my database is not there, it is 2 Folders back (i.e. on the same path but without the "\bin\Debug" & that is what my Connection String says, so why is the program trying to look into the bin\Debug folder, which I guess is where it was stored when it was set to "Copy if Newer" ?!?!?

Help !!!
Posted 16-Jul-12 5:35am
Comments
Richard MacCutchan 16-Jul-12 11:48am
   
You need to copy your database to a fixed location and access it from there. You should only be doing the copying during the project development phase while the structure of your tables may be changing. Once you have the design right then use the fixed location database, so all updates will be saved in that file and it will not get destroyed while rebuilding your project.
Gary Heath 16-Jul-12 11:54am
   
OK, I understand what you are saying, conceptually, but am a bit confused by your wording, sorry Richard ! My Database is in a fixed location now and I am happy to access it from there until my testing has finished, but are you saying I should copy that to somewhere else and access it from there instead ? What about the Settings, should I have that set to "Do Not Copy" or "Copy if Newer" ?!? Some of this Visual Studio stuff is brilliant, but some of it is still so confusing !!!
Richard MacCutchan 16-Jul-12 12:06pm
   
As I understand it if you set to "Copy if newer", it should only copy the blank database to your execution directory if you change anything in it. Having had problems myself, however, I would suggest you move the final version to a directory that will not get overwritten and access it from there. You just need to change your connection string to the new location. You can try setting to "Do not copy" and see if that works OK.
Gary Heath 16-Jul-12 14:25pm
   
OK, got the Database back, thanks, but I had to actually delete it and add it again as a new Source ... VS2010 is so clever & so stupid at the same time !!!

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Had to delete & add Dataset again as a new data source. Working now though ...
  Permalink  
Comments
Sebastian T Xavier 17-Jul-12 1:20am
   
This is not a solution
Gary Heath 17-Jul-12 3:57am
   
It worked for me ...

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.180618.1 | Last Updated 16 Jul 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100