0

I'm using Visual Studio 2015, building a Windows Forms project. I'm a web programmer by trade, but was tasked to create this project. I've gone through a couple dozen questions on SO, so before you knock me for a repeat question, I've been coming through a lot of mostly unanswered questions on here for over an hour, and I still can't find a solution. Here is what I've done so far:

1) Created a project in VS2015
2) Added a Service-based database
3) Created a table in said database
4) Created a form
5) On the Data Sources tab, I found my table, used the dropdown to change to DataGridView, then dragged-and-dropped it onto my form.
6) Back on the Data Sources tab, I found my table, used the dropdown to change to Details, then dragged-and-dropped it onto my form.

I Ran the project, it will add, edit and delete records on the form. But when I close the form and go to the Server Explorer, right click on my table and choose "Show Table Data", none of the records saved.

I looked at the code behind the "Save" button and it looks like this:

private void testOneBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
    this.Validate();
    this.testOneBindingSource.EndEdit();
    this.tableAdapterManager.UpdateAll(this.cII_LocalDataSet);
}

What am I missing?

Todd K
  • 73
  • 1
  • 13
  • You are looking at a different database than the one updated. [Why saving changes to database fails?](https://stackoverflow.com/questions/17147249/why-saving-changes-to-a-database-fails/17147460#17147460) – Steve Jun 12 '18 at 17:10
  • Ugh, thanks @Steve. So I created a new connection to the BIN/DEBUG file and now I see the data. Where would I find the "Copy to Output Directory" setting? If you want to post this as an answer, I'll check it as accepted. – Todd K Jun 12 '18 at 18:07
  • You have your database file listed between your project files. Right click on it and change the property. If you don't mind I close this question as a duplicate. – Steve Jun 12 '18 at 19:08
  • Found it. Thanks again. – Todd K Jun 12 '18 at 19:14

0 Answers0