Home All Groups Group Topic Archive Search About

Updating DataTable bound to a DataGridView

Author
26 Jul 2006 11:09 PM
Carlos Cruz
Hi,

I've a DataGridView with Datasourse = Datatable.
The problem is that I can't get my last record updated at the database
unless I change the row where I'm editing...
Can anyone explain me why and how can I manage to get rid of this?

By the way, Im' updating with DataAdapter.Update(DataTable)

Thanks in advance
CC

Author
27 Jul 2006 4:19 AM
Cor Ligthert [MVP]
Carlos,

Was that in past (version 1.x) the currentmanager.endcurrentedit is it now
the  Bindingsource.endedit which is doing the trick to force the rows into
the datasource.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingsource.endedit.aspx

I hope this helps,

Cor

Show quoteHide quote
"Carlos Cruz" <carlos.msm.c***@gmail.com> schreef in bericht
news:u58NfiQsGHA.1304@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> I've a DataGridView with Datasourse = Datatable.
> The problem is that I can't get my last record updated at the database
> unless I change the row where I'm editing...
> Can anyone explain me why and how can I manage to get rid of this?
>
> By the way, Im' updating with DataAdapter.Update(DataTable)
>
> Thanks in advance
> CC
>
Author
27 Jul 2006 7:08 PM
JeremyGrand
Cor, I'm having a similar problem.  Tried dropping a bindingsource on my
form & used it as the datasource for my datagridview. Assigned my dataset as
datasource for the bindingsource.  However, this seems to have no effect -- 
no rows are displayed (if I use the dataset as the datasource for the grid,
I do have rows).  What is the magic step I'm leaving out?

Jeremy

Show quoteHide quote
> Was that in past (version 1.x) the currentmanager.endcurrentedit is it now
> the  Bindingsource.endedit which is doing the trick to force the rows into
> the datasource.
>
> http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingsource.endedit.aspx
>
Author
28 Jul 2006 9:27 AM
Cor Ligthert [MVP]
Jeremy,

Did you do it like this?

http://www.vb-tips.com/dbpages.aspx?ID=1139f14a-c236-4ad7-8882-b1ed16424252

Cor

Show quoteHide quote
"JeremyGrand" <jer***@ninprodata.com> schreef in bericht
news:%23CJljAbsGHA.356@TK2MSFTNGP05.phx.gbl...
> Cor, I'm having a similar problem.  Tried dropping a bindingsource on my
> form & used it as the datasource for my datagridview. Assigned my dataset
> as datasource for the bindingsource.  However, this seems to have no
> effect --  no rows are displayed (if I use the dataset as the datasource
> for the grid, I do have rows).  What is the magic step I'm leaving out?
>
> Jeremy
>
>> Was that in past (version 1.x) the currentmanager.endcurrentedit is it
>> now the  Bindingsource.endedit which is doing the trick to force the rows
>> into the datasource.
>>
>> http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingsource.endedit.aspx
>>
>