views:

237

answers:

1

Good Day created Windows form application in c#, created a data source in c# from the my MS Access database 'inspro' on the form I coded for the save button:

        try
        {
            this.Validate();
            this.entitiesBindingSource.EndEdit();
            this.entitiesTableAdapter.Update(this.iNSPRODataSet.Entities);
            MessageBox.Show("Update successful");
        }
        catch (System.Exception ex)
        {
            MessageBox.Show("Update failed");
        }

I get the msg box that says "Update successful", but when I check in ms access, nothing is updated,

thanks!

+1  A: 

It could be related to the EndEdit() bug that has caught many others. If it moves the focus, that could be why you're not seeing the save you're expecting.

Another possibility, read the comments at the bottom of this page, it has to do with a copy of the MDF moving to the debug folder, effectively overwriting the changes.

{EDIT} As pointed out by Julien, the second article I mentioned references an MDF (SQL Server), and access would be a MDB, but the theory there is still sound. Check to see if the included file is set to copy to output directory.

curtisk
You're right, my answer had nothing to do with the question. I deleted it. BTW, he's using Access, so it's an .mdb file
Julien Poulin
right you are! thanks for the catch
curtisk