Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where's the row?
Message
From
12/02/2003 13:00:18
 
 
To
06/02/2003 12:31:57
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00749976
Message ID:
00752344
Views:
17
Hi Bonnie,

How does the new row get added to the end of the real dataset; table?

I do not understand the following line. Where does it get the position?
BindingContext(ds, "Listing").Position = ds.Tables[0].Rows.Count
Thanks
Roland
==========================================================================
>Roland,
>
>I think it's been mentioned here before that it's better to add a row with the Table's NewRow() method than with the BindingContext's AddNew() method. So, you'd do something like this (remember, I use C#, so my VB syntax may be slightly off):
>
>
>  DataRow row = ds.Tables[0].NewRow()
>  ds.Tables[0].Rows.Add(row)
>  BindingContext(ds, "Listing").Position = ds.Tables[0].Rows.Count
>
>
>~~Bonnie
>
>
>>Hi,
>>
>>When the following code is executed I get an error message:
>>
>>There is no row at position.
>>
>> 'Add a New Record
>> Me.Pending01_DS1.Listing.Clear()
>> Me.BindingContext(Pending01_DS1, "Listing").AddNew()
>>
>> ' Defaults for New Listing in Table
>> Dim iAddCurrRow As Integer
>> iAddCurrRow = Me.BindingContext.Pending01_DS1, "Listing").Position
>> Me.Pending01_DS1.Tables("Listing").Rows(iAddCurrRow).Item("DateInsert") = Now
>>
>>Where is the row I just added with AddNew command?
>>
>>What do I need to do to correct this error?
>>
>>Thanks
>>Roland
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform