Click to See Complete Forum and Search --> : [RESOLVED] EndEdit Doesn't Add Record!


fallnwrld
August 29th, 2009, 05:45 AM
Ok... this is driving me nuts.

I have a DataGridView that loads an Access database when the application starts. I also have a bunch of text boxes that are bound to the same database. When you click on a row in the DataGridView the text boxes display the data for the record you clicked on.. perfect so far... now when I want to add a new record..

I do...

BindingSource.AddNew()

This removes all the data from the textboxes and I start typing away.

When im done I hit a Save button with the following code.

BindingSource.EndEdit()

It removes all the data from the text boxes but never saves to the database! What am I doing wrong?

DataMiser
August 29th, 2009, 09:55 AM
.Update ?

fallnwrld
August 30th, 2009, 04:54 PM
BindingSource doesn't have have an .update option?

dglienna
August 30th, 2009, 09:37 PM
Read this:

http://www.developer.com/net/vb/article.php/3558771

fallnwrld
August 30th, 2009, 11:01 PM
Thanks that post helped. I was manually trying to bind them instead of just dragging and dropping the controls from the dataset onto the form.