Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have to tell us exactly what connection string you are using, saying things like "I updated the connection to point to the database in the bin folder" is not helpful. Are you using a connection string like <code>c:\Users\Me\Visual Studio 2010\Projects\MyProject\bin\debug\HKRMoviesDB.sdf</code>? That is not right, that is hard-coded to your VS2010 debug test folder on your machine, and will not work for anyone else, will only work when you run from the debugger, and will not work when you deploy your app.</p> <p>ADO.NET looks for vertical bars in connection strings and expands the enclosed string using the AppDomain property. For example, if you use <code>Data Source=|DataDirectory|\HKRMoviesDB.sdf</code> from the VS debugger, <code>DataDirectory</code> expands to your project's bin folder, where VS copies the debug DLLs. If you deploy your app using an MSI installer, <code>DataDirectory</code> expands to your app's install folder chosen by the user. Further explanation is at <a href="https://stackoverflow.com/a/12268705/22437">this answer</a>.</p> <p>Be aware that <code>DataDirectory</code> may not be a directory writable by users; it is a good directory for read-only data, but if you want users to write to the file you should copy it to <code>Environment.SpecialFolder.ApplicationData</code> or somewhere in your app, as explained in <a href="https://stackoverflow.com/a/13296809/22437">this answer</a>.</p> <p>There is one more thing to keep in mind. When you are debugging you typically want to copy your original source data to the debug folder, test it, then discard your test data because you typically do not want your test data included in the final deployment. This is what the "Copy to Output Directory" property in your project does. If it is set to "copy if newer", which it probably should be, then any changes you make to your test data is temporary; the next time you update your original source data in your project, your test data will be discarded. Remember, your application's deployment directory is typically not writable by users so you should not be writing user data in <code>DataDirectory</code> anyway.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload