C# windows form application with access database

Feb 15 2018 11:18 PM
I connected my database file to the visual studio using data source.
   I open data source window and add data source. When add data source it prompted the below message box.
 
I clicked yes button. Then data file is copied to the project directoy.
DataFile 1 -  C:\Users\mypc\Documents\Visual Studio 2010\AutoSpa Xpress\AutoSpa                        Xpress\bin\Debug
DataFile 2 -  C:\Users\mypc\Documents\Visual Studio 2010\AutoSpa Xpress\AutoSpa Xpress
 
Original datafile is located in
   DataFile 1
After I did above operation data file is copied to
    DataFile 2
 
My connection string of app.config is 
   ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = |DataDirectory|\AutoSpa.mdb"
 
Connenction String name is
   "AutoSpa_Xpress.Properties.Settings.AutoSpaConnectionString"
 
Provider Name
   System.Data.OleDb
 
My Problem is
   When I insert some values using windows form they are inserted into data file ( DataFile 1) , but data file (DataFile 2) not update (There is no new value which i was added). 
   When I re-run my project data load from Data File 2 and DataFile 2 is overwrite on DataFile 1. Values which I was inserted are missing.
 
How to solve this problem? 

Answers (1)