hi good afternoon sir,

                i am creating one vb.net project ,it is working nicely but the problem is when am adding datas to database it is adding but when am stop that execution and start it again it is deleting the records ...how can i solve this

Recommended Answers

Ensure you are committing the data to the database.

Jump to Post

All 3 Replies

Ensure you are committing the data to the database.

i have added the database in twoways to y project one is i copy pasted the database into bin/debug section and the other one is rightclick the project and select add newitem and i have added the database when am adding it is working nicely but why it is deleeting please tell me some some solution

How to: Manage Local Data Files in Your Project

Copy to Output Directory setting

-Copy always (default for .mdf and .mdb files):

...The database file is copied from the project directory to the bin directory every time you build your application. Every time you build your application and save changes to the data, those changes are overwritten when the original file is copied to the bin directory, replacing the copy that you just changed. You do not see the updated data the next time you run your application. Any changes made to the data file in the output folder will be overwritten the next time you run the application....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.