I created a windows form in visual studio 2019 and l connected it to local database....but when l rebuild the project all the data removed from the database..why??
Asked
Active
Viewed 1,320 times
-1
-
We will need some code before we can answer this, preferably a [mcve] – phuzi Apr 06 '20 at 10:24
1 Answers
1
As commented on your question, it's not very clear how you are implementing the database.
I'm going assume that by the fact the data is not persisting that you are using a SQL Database file?
If this is the case then you want to make sure that you are not copying the DB to the output directory every time you build
If you are looking for data to persist across sessions then it would be better to host a local SQL Server. Check out Tim Corey's guide to SQL Database management and C# https://www.youtube.com/watch?v=ijDcHGxyqE4

Simon Curtis
- 382
- 2
- 9