Bob,
I cannot answer yes or no on your question, because when you do the database
updates while editing it can be that you use it. But it has forever to do
with update from a database as long as you don't do that, you normally
should not use the acceptchanges.
The acceptchanges can be used by instance in this sentence.
myDataAdapter.Update(myDataTable.getchanges)
Not that this gives any advantage but let assume.
The dataadapter marks the rowstate of rows which are done as not changed.
But the myDataTable.getchanges is a copy of the datatable, so it has to be
done in the origanal as well.
Therefore than the myDataTable.acceptchanges which means that those rows
will not be updated again.
I hope that this makes it a little bit clear because there are not much
samples to give where it has to be used. It is not rare to use it, but there
are very few places (a cascade update by instance can need it as well).
Cor
<(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Cor, I am not clear on what you mean by saying "If means something as
> Accept changes as done." Does this mean you should AcceptChanges
> (update the database on disk) only when you are done and exit the
> DataGrid/program, and not during the editing process? Or, is it
> recommended to confirm/write/update a small portion of the data (ie,
> the row you just changed) right away? If the latter, how to you do
> that?
>
> Thanks.
> (E-Mail Removed)
>
> Cor Ligthert [MVP] wrote:
>> MFleet,
>>
>> I would try it by refreshing the datagrid.
>>
>> http://msdn.microsoft.com/library/de...freshtopic.asp
>>
>> More worse is the acceptchanges in your code.
>> It means that all the data in your dataset should be handled as been
>> updated
>> to the database.
>>
>> (You are not the first one who interprets this command wrong)
>> :-)
>> If means something as Accept changes as done.
>>
>> I hope this helps,
>>
>> Cor
>>
>>
>> <(E-Mail Removed)> schreef in bericht
>> news:(E-Mail Removed)...
>> > Hello. I'm fairly new to VB.Net (2003). I'm using a datagrid to
>> > display data (access db) and when user double clicks on a record,
>> > another form shows up which allows modification/addition of data. The
>> > problem is when user accepts the changes made and gets back to
>> > datagrid. The information displayed is still the old info. How do I
>> > get the new information to display? Here is an example of the code
>> > used to update the data:
>> >
>> > objDataSet.Tables("Table").Rows(objCurrencyManager.Position).BeginEdit()
>> > objDataRow =
>> > objDataSet.Tables("Table").Rows(objCurrencyManager.Position)
>> >
>> > With objDataRow
>> > .Item("Field1") = Text1.Text
>> > End With
>> > objDataRow.AcceptChanges()
>> > objDataSet.Tables("Table").Rows(objCurrencyManager.Position).AcceptChanges()
>> >
>> > Shouldn't the data in the datagrid diplay the information that was
>> > entered in Text1.Text? Or is it that I'm doing something wrong?
>> >
>> > Many thanks for any replies!!
>> >
>