Datagridview not saving changes to Database.
Just in the form but not the database.
I've checked Database Properties and Copy to output Directory
is set to cope if newer
.
Here is my code :
public partial class ClientsManager : Form
{
public ClientsManager()
{
InitializeComponent();
}
private void clientsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
try
{
this.Validate();
this.clientsBindingSource.EndEdit();
//this.tableAdapterManager.UpdateAll(this.databaseDataSet);
this.clientsTableAdapter.Update(this.databaseDataSet.Clients);
MessageBox.Show("Changes has been Saved!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void ClientsManager_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'databaseDataSet.Clients' table. You can move, or remove it, as needed.
this.clientsTableAdapter.Fill(this.databaseDataSet.Clients);
}
Most Solutions I've read so far were about EndEdit()
and Update()
.. I've this in my code and still not working.