Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Deleting Items in a DataGrid

Reply
Thread Tools

Deleting Items in a DataGrid

 
 
baGo
Guest
Posts: n/a
 
      04-10-2004
Hi all,

i use this code taken from MSDN at the address:

http://msdn.microsoft.com/library/de...isualbasic.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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting data from the file without deleting the file first crea C++ 2 12-28-2012 11:50 PM
Deleting items to deleted items folder. Geopelia NZ Computing 16 11-13-2012 05:49 AM
Any way to reorder how a datagrid is drawn (header/footer/items vs.header/items/footer)? Henrik ASP .Net Datagrid Control 1 07-06-2006 12:23 AM
Deleting a File from Hardrive and Deleting a SubKey in Registry Harry Barker C++ 2 04-19-2006 09:34 AM
deleting items checked on page 2 in datagrid gh0st54 ASP .Net Datagrid Control 0 08-23-2004 05:38 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57