M
MU
Hello,
How would I access the Delete command from a button in a DataList that
is databound to a SQLDataSource and the whole thing is within a
Repeater control?
This is what I have right now:
Protected Sub lstItineraryDayItems_DeleteCommand(ByVal source As
Object, ByVal e As DataListCommandEventArgs)
Dim dList As DataList = repeaterDays.Controls
(repeaterDays.Controls.Count - 1).FindControl("lstItineraryDayItems")
Dim sqlItin As SqlDataSource = repeaterDays.Controls
(repeaterDays.Controls.Count - 1).FindControl("sqlItineraryDayItems")
Dim id As Integer = CInt(dList.DataKeys(e.Item.ItemIndex))
sqlItin.DeleteParameters("ItineraryDayItemsID").DefaultValue =
id
sqlItin.Delete()
End Sub
But I'm not sure if that is correct and I'm not sure how I would call
if it is....
Any help would be great!
Thanks
How would I access the Delete command from a button in a DataList that
is databound to a SQLDataSource and the whole thing is within a
Repeater control?
This is what I have right now:
Protected Sub lstItineraryDayItems_DeleteCommand(ByVal source As
Object, ByVal e As DataListCommandEventArgs)
Dim dList As DataList = repeaterDays.Controls
(repeaterDays.Controls.Count - 1).FindControl("lstItineraryDayItems")
Dim sqlItin As SqlDataSource = repeaterDays.Controls
(repeaterDays.Controls.Count - 1).FindControl("sqlItineraryDayItems")
Dim id As Integer = CInt(dList.DataKeys(e.Item.ItemIndex))
sqlItin.DeleteParameters("ItineraryDayItemsID").DefaultValue =
id
sqlItin.Delete()
End Sub
But I'm not sure if that is correct and I'm not sure how I would call
if it is....
Any help would be great!
Thanks