0

Hi All,

i am creating a Desktop application using Microsoft Visual Studio .NET 2008..
i am using .sdf file as my database...
my problem is that when i am making changes to my records (add new, deleted, updated) then the changes reflects only till my application is running when i restart the application then i am not getting my changes...

I am using the default connection string

string conString = Properties.Settings.Default.DataConnectionString;
 SqlCeConnection con = new SqlCeConnection(conString);
 con.Open();

the value given by the visual studio for this database is

Data Source=|DataDirectory|\Data.sdf

i dont know what mistake i am doing ,, but all the queries are executing....

Thanks
vince

2
Contributors
5
Replies
8
Views
6 Years
Discussion Span
Last Post by Momerath
0

yes i am.. what that has to do with this.. can you explain.. i don't know that..


thanks for reply
vince

0

When you run in debug mode the system makes a copy of your sdf file to work with, so that it doesn't ruin the original.

0

yes i got it.. i have changed the database copy as 'Do not Copy' and manually placed a copy of my database in the bin/debug folder .. now for the moment it is working fine.. is this the right way..

thanks
vince

0

It is a way that will work. The system uses a copy when debugging so you can recreate problems that occur (if it made changes, then you'd have to constantly restore the old database to test again).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.