Home All Groups Group Topic Archive Search About

Database & Datagrid issues

Author
13 Nov 2006 9:09 PM
Warex
Hello I am having a problem with using the datagrid.
I am attaching my data through a dataset via code to a
datagridview.datasource.
All if fine except if I make any changes to the datagrid the changes never
reflect in the database.

Does anybody have a sample/example of how to use the datagridview with code
not the wizard?

thanks

Author
13 Nov 2006 9:22 PM
Izzy
You'll need to update the database with the changes made to the
datatable the grid is bound too.

Check out DataTable.GetChanges() method to get a copy of the changes
that were made since the table loaded or since the
DataTable.AcceptChanges() method was last called.

Izzy

Warex wrote:
Show quoteHide quote
> Hello I am having a problem with using the datagrid.
> I am attaching my data through a dataset via code to a
> datagridview.datasource.
> All if fine except if I make any changes to the datagrid the changes never
> reflect in the database.
>
> Does anybody have a sample/example of how to use the datagridview with code
> not the wizard?
>
> thanks
Author
14 Nov 2006 5:01 AM
Cor Ligthert [MVP]
Warex,

If you want to use the Datagrid than you should not connect to the
DataGridView.Datasource,

Use the DataGrid.Datasource.

Cor

Show quoteHide quote
"Warex" <Igiveitalla***@juno.com> schreef in bericht
news:OZB6Qg2BHHA.4928@TK2MSFTNGP02.phx.gbl...
> Hello I am having a problem with using the datagrid.
> I am attaching my data through a dataset via code to a
> datagridview.datasource.
> All if fine except if I make any changes to the datagrid the changes never
> reflect in the database.
>
> Does anybody have a sample/example of how to use the datagridview with
> code not the wizard?
>
> thanks
>