简体   繁体   中英

TableAdapter update SQL server CE

I am trying to update my SQL Server CE database after commiting changes to a typed dataset. The changes are all in the table but won't update to the database. Thank you in advance!

static MoviesTableAdapter adapter;
static MovieDataSet dataset;
static MovieDataSet.MoviesDataTable table;

adapter = new MoviesTableAdapter();
dataset = new MovieDataSet();
table = adapter.GetData(); 

MovieDataSet.MoviesRow row = table.NewMoviesRow();
row.example = example....
table.AddMoviesRow(row);

adapter.Update(table);

This happens a lot with SQL Server CE, or Access, or any other file based database. You have a copy of the database on the solution folder, and it's copied to /bin/debug everytime you run your solution: that's the version you gotta check to see if your changes are persisted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM