Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New Record
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Miscellaneous
Thread ID:
00736527
Message ID:
00736872
Views:
7
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
System Analyst
Nabil B. Ghrayyeb
nabilg@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform