|
-
How to loop through rows in Datalist control?
I know how to edit one line in the Datalist. For example,
Item Quantity
Update Skirt 20
But I don't know how to update if more than one line. For example,
Item Quantity
Skirt 20
Dress 10
Jacket 10
Update
After the user clicks Update, I want to loop through it and insert into a table line by line . I tried to use intIndex instead of e.Item.ItemIndex, but it boomed at strItem = tbox.Text.ToUpper. Is it possible to loop through it? If so, can you please help? Thanks.
Private Sub dblRoleItemNew_UpdateCommand(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) _
Handles Datalist1.UpdateCommand
Dim tbox As TextBox
Dim intItemID, strItem, tbox1, insertSQL As String
Dim intIndex As Integer
For intIndex = 0 To Session.Item("TotalItems") - 1
intItemID = Datalist1.DataKeys(intIndex).ToString
'find the textbox control containing the menu item security
tbox = DirectCast(Datalist1.FindControl("txtItem"), TextBox)
strItem = tbox.Text.ToUpper
insertSQL = “……”
Next
End Sub
Dan-Yeung
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks