Deleting Items in a DataGrid

Discussion in 'ASP .Net Datagrid Control' started by baGo, Apr 10, 2004.

  1. baGo

    baGo Guest

    Hi all,

    i use this code taken from MSDN at the address:

    http://msdn.microsoft.com/library/d...indatagridordatalistwebcontrolvisualbasic.asp

    01 Private Sub DataGrid1_DeleteCommand(ByVal source As Object, _
    02 ByVal e As
    System.Web.UI.WebControls.DataGridCommandEventArgs) _
    03 Handles DataGrid1.DeleteCommand
    04 Dim customerid As String
    05 Dim l As Label
    06 l = CType(e.Item.FindControl("Label1"), Label)
    07 If (Not l Is Nothing) Then
    08 customerid = l.Text
    09 Dim customerid As String = e.Item.Cells(3).Text
    10 Dim dr As DataSet1.CustomersRow
    11 dr = DataSet11.Customers.FindByCustomerID(customerid)
    12 dr.Delete()
    13 SqlDataAdapter1.Update(DataSet11)
    14 DataGrid1.DataBind()
    15 End If
    16 End Sub

    well it work's great but i don't understand very well the code.

    Why there're two declaration of "customerid"?
    What's means line 6 and 9?????


    thank's All
     
    baGo, Apr 10, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NFish
    Replies:
    6
    Views:
    15,333
    Andrey Tarasevich
    Nov 7, 2003
  2. Harry Barker
    Replies:
    2
    Views:
    529
    Alf P. Steinbach
    Apr 19, 2006
  3. gh0st54

    deleting items checked on page 2 in datagrid

    gh0st54, Aug 23, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    140
    gh0st54
    Aug 23, 2004
  4. Henrik
    Replies:
    1
    Views:
    442
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
  5. crea
    Replies:
    2
    Views:
    423
    Nobody
    Dec 28, 2012
Loading...

Share This Page