Do you have any articles regarding the bugs of using BindingContext object?
What is the best practice of using the methods on the DataTable on a form that contains a binded controls?
I tried the following for adding a new record:
Dim NewRow As DataRow = myDataTable.NewRow()
Dim i, j As Int16
i = myDataTable.Columns.Count - 1
For j = 0 To i
If Not myDataTable.Columns(j).AllowDBNull Then
NewRow(j) = 0
End If
Next
myDataTable.Rows.Add(NewRow)
IS IT OK?
>Hi Victoria,
>
>I would recommend using the methods on the DataTable itself instead of the BindingContext object. There are some known bugs that can cause inconsistencies with the CurrencyManager to add and cancel changes.
>
>>I want to add new record to my dataset.
>>
>>I'm confused, should I use
>>myDataTable.NewRow()
>>OR
>>Me.BindingContext(myDataSet, myMainDataTable).AddNew()
>>
>>Also what to use to cancel the newly added record?
>>myDataTable.RejectChanges()
>>OR
>>Me.BindingContext(myDataSet, myMainDataTable).CancelCurrentEdit