Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Update Not Bounded Fields
Message
 
To
09/01/2003 12:45:39
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00739818
Message ID:
00740098
Views:
37
No deer I don't think so,

Say the total rows in the DataRow is 5, when .AddNew, the new record will be 6, so I should move the pointer to the new position (empty row) which it's 6, which .position = .count, becuase counting in DataRow start from 1
BUT
for the ComboBox (cbselect), the counter start from 0, so the last record should be .count -1., if I said cbselect.selectedindex = bindingcontext(...).count this will rease an error.




>Hmmm, the only thing that looks suspicious to me is that BindingContext.Postion should be equal to .Count - 1, not .Count, maybe that's the problem.
>
>
>
>>No, Same effect.
>>Maybe I have a misstake with the way I add the new record, see this when I click "Add" button:
>>
>>Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
>>pbbolAddNew = True
>>
>>myDA.InsertCommand = myCB.GetInsertCommand
>>
>>With BindingContext(myDS, "Company")
>> .AddNew()
>> .Position = .Count
>> cbSelect.SelectedIndex = .Count - 1
>>End With
>>End Sub
>>
>>Then I'll be in the window form to type in the data, then click the "Save" button which take the effect I mentioned down.
>>
>>Does this way effect my problem ?
>>
>>
<><><><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><><><>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform