B
baGo
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
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