English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I've created a database and simple app that allows you to do the basics (edit, add, delete etc). When I debug/run app and make changes to data, it won't save using the save button, OR save automatically on exit. I added this code to the form closing event handler but still doesn't work:

Me.AddressesBindingSource.EndEdit()
Me.AddressesTableAdapter.Update(Me.FirstDatabaseDataSet.Addresses)

:-s

2006-06-21 07:29:46 · 1 answers · asked by Anonymous in Computers & Internet Programming & Design

Nevermind... it works in the .exe just not in the debugger! Why is this? Is this gonna happen a lot with other apps I make? I'm new to all this, have a huge learning curve ahead (yay, fun!)

2006-06-21 11:34:40 · update #1

1 answers

A data adapter has to be set up to actually update data. You need to either use a CommandBuilder and give the DataAdapter its GetUpdateCommand() method to its .UpdateCommand property, or you have to write the SQL for the UpdateCommand yourself.

The fact that it is not saving for you either way should be your clue that the problem is with your saving procedure, and not the exit event.

2006-06-21 07:42:59 · answer #1 · answered by evolver 6 · 0 0

fedest.com, questions and answers