I have a form with some text boxes, bound to a table in a DataSet. I can create a new row like this:
After moving to the new record, you enter in your new data. I'm having trouble committing the data to the DataSet (not the DB). If I click my save button, default values, not the values typed in get sent to the db. A work around is to change the BindingManagerBase.Position like this, but it doesn't seem right:Code:ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
Is there a better way to commit the changes to the DataSet?Code:private void btnSaveAndClose_Click(object sender, System.EventArgs e) { // Cheezy hack to commit the new record btnNext_Click(null, null); // Moves to the last record of the table. // End cheezy hack statusBar1.Text = "Updating..."; DataSet changes = ds.GetChanges(); . . .


Reply With Quote