I followed "10 Creating a database part 1 & 2". I got the perfect result of showing book details. After I make a change to field, ex. change author name, I click on save button of BindingNavigator. After closing application, I run it again, what I had changed disappear. Author name turn back to original one!
Did I miss something?
I followed "10 Creating a database part 1 & 2". I got the perfect result of showing book details. After I make a change to field, ex. change author name, I click on save button of BindingNavigator. After closing application, I run it again, what I had changed disappear. Author name turn back to original one!
Did I miss something?
add new comment
I found the solution.
- I selected copy database into project environment that make vc# to copy .mdf into my project directory.
- At Solution Explorer I see Books.mdf. In its properties "Copy to Output Directory" --> "Copy always" was selected. That mean every time I run my application, the original database will be copy to my output directory!! Everything I had changed last time I ran will be replaced.
- Solution is change property value from "Copy always" to "Copy if newer"