Home All Groups Group Topic Archive Search About

Saving data from datagridview

Author
7 Feb 2006 9:47 PM
Bob Simoneau
I have a access database with one table, which two columns.  The columns are
name which is text, and present which is a boolean.  I create a new windows
application, and include the table using wizard.  I then drop the table onto
my main form.  VB creates a tableadapter, bindingsource, datagridview, and a
bindingnavagrator.  I can see my data from the table in the grid, so the
tableadapter.fill works.  VB also added the code for the navagator save
button.  If I change the data in the grid, or use the navagator add button
the records do not get saved.  When I exit and re-enter the application the
changes are missing.  The book I am learning with implies I do not have to
add code.  Am I missing something?

Thanks

Author
8 Feb 2006 3:13 AM
Val Mazur (MVP)
Bob,

Changes do not go automatically to the database until code will call Update
method of the DataAdapter. This is disconnected environment and you need to
do it explicitly

--
Val Mazur
Microsoft MVP
http://xport.mvps.org


Show quote
"Bob Simoneau" wrote:

> I have a access database with one table, which two columns.  The columns are
> name which is text, and present which is a boolean.  I create a new windows
> application, and include the table using wizard.  I then drop the table onto
> my main form.  VB creates a tableadapter, bindingsource, datagridview, and a
> bindingnavagrator.  I can see my data from the table in the grid, so the
> tableadapter.fill works.  VB also added the code for the navagator save
> button.  If I change the data in the grid, or use the navagator add button
> the records do not get saved.  When I exit and re-enter the application the
> changes are missing.  The book I am learning with implies I do not have to
> add code.  Am I missing something?
>
> Thanks
>
>
>

AddThis Social Bookmark Button