Thanks for interest.
But I cannot insert all the code in 1 mail because its spread among
many files but im clearing main lines with following  steps.

1.I fill my table with query.
2.I Inserted new row in Grid and I got Inserted row.
     dim row as datarow=grid.addnewrow.
row("ID")=1
After some more events.
3.row("ID")=5 'I Checked with another row values that row is same as above.

4.Then I saved the record with folowing code.
   adapter.update(table)

Main Point is it works fine most of  99% times , but cause problem
only some times.
I solved this problem by writing

row.acceptchanges
row.SetRowAdded
adapter.Update(Table)

But I want to know possible reason of this situation.
Why dataadapter is not taking latest value to update datasource?








On 2/26/09, Cerebrus <[email protected]> wrote:
>
> Show us (the relevant part of) your code.
>
> On Feb 26, 8:18 pm, "[email protected]"
> <[email protected]> wrote:
>> Hi Guys,
>> Im Inserting row in Database with DataAdapter.Update(DataTable)
>> method.
>> Its working fine with No error.
>>
>> But Sometimes if I write like
>>
>> table.Row(i).Item("ColName")=5    ' My Previous  value is 1 and
>> replacing with 5
>>
>> Here ,
>> Current Value is  1
>> Proposed Value Is 5
>>
>>  Then Execute  :
>> DataAdapter.Update(Table)
>>
>> then execute Update  method of DataAdapter then
>> It will Insert  '1' Instead of  '5'.
>>
>> From My reasearch I Found that Particular Items
>> Current Value is Still 1 Before Update  and
>> Proposed Value Is 5.
>>
>> What can be the problem?

Reply via email to