Can I commit changes to actual database while debugging C# in Visual Studio?

Posted by nathant23 on Stack Overflow See other posts from Stack Overflow or by nathant23
Published on 2011-01-13T07:50:28Z Indexed on 2011/01/13 7:53 UTC
Read the original article Hit count: 254

Filed under:
|
|
|
|

I am creating a C# application using Visual Studio that uses an SQLExpress database. When I hit f5 to debug the application and make changes to the database I believe what is happening is there is a copy of the database in the bin/debug folder that changes are being made to.

However, when I stop the debugging and then hit f5 the next time a new copy of the database is being put in the bin/debug folder so that all the changes made the last time are gone.

My question is:

Is there a way that when I am debugging the application I can have it make changes to the actual database and those changes are actually saved or will it only make changes to the copy in the bin/debug folder (if that is what is actually happening)?

I've seen similar questions, but I couldn't find an answer that said if it's possible to make those changes persistent in the actual .mdf file.

The reason I ask is because as I build this application I am continuously adding pieces and testing to make sure they all work together. When I put in test data I am using actual data that I would like to stay in the database. This would just help me not have to reenter the data later.

Thanks in advance for any help or information that could help me better understand the process.

© Stack Overflow or respective owner

Related posts about c#

Related posts about database