I've created a SQL Compact Local DB in my app, added a Dataset for the tables that I created, and want to insert data into the table now.
When I execute the Insert
TableAdapter method it seems to insert the data into the table, because when I Fill
the DataTable after the insert there is 1 record there, however when I restart the app there is no data anymore.
Even after the insert when I query the table through Server Explorer
, still no data. Do I miss something important, because I cannot seem to find that I shoud do anything else.
On App Startup
private void MainForm_Load(object sender, EventArgs e)
{
personsTA.Fill(ds.Persons); //ds.Persons.Count is 0;
MyInsert();
}
private void MyInsert()
{
personsTA.Insert(<all the params>); //This returns 1
//ds.Persons.Count still returns 0
personsTA.Fill(ds.Persons); //ds.Persons.Count now returns 1;
}
But when I restart the app, the Fill
returns 0 again. Do I have to commit the data somehow or something? Is there a setting I need to change?
Thanks