Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Update Not Bounded Fields
Message
From
09/01/2003 18:00:34
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00739818
Message ID:
00740100
Views:
29
>>No deer I don't think so,<

I'm in a good mood, so I'll ignore that remark (for now).

All collections are zero-based. If your row count is 6, your rows go from 0 to 5.

~~Bonnie

>
>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 ?
>>>
>>>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform