Data bound form data update

tkeats

New member
Joined
Mar 18, 2009
Messages
1
Programming Experience
1-3
Hi there,

I have a simple databound form in VS 2008 but the default set up for the form seems not to update the data in the database and the save button on the data navigator tool strip is disabled.

I believe I have to write some code to save changes the user makes in the bound text box of the form. Can anyone help - I think there is a currentRecord property of one of the objects and an update method. Assume any names for the bindingSource and DataTable objects.

Thanks
 
You should check your TableAdapter in the DataSet designer to make sure that it actually has objects assigned to the InsertCommand, UpdateCommand and DeleteCommand properties. If it doesn't then it's incapable of saving data, which would explain the disabled Save button. I think that the code to save would be auto-generated if the TA supported it.
 
If the situation described by jmc and mattp is true, you ought to have received an information box when making the tableadapter, that it was not able to generate the necessary update etc queries because no primary key information was included in the select list (and do you want to include it?)

If you did not recive such a message, check that you actually put a tick in the options (in the table adapter wizard) to generate the I/U/D queries, and that the datasource you have attached to actually supports updating
 
Back
Top