PDA

View Full Version : Fully Editable Gridview in ASP.Net 2.0???


gtjr92
05-05-2005, 10:12 AM
I am trying to create a fullyeditable gridview in asp.net 2.0 To accomplish this in 1.1 you would do something like below.
How can this be accomplished in ASP.Net 2.0? I am not sure how to call my query commands etc. This is for an access DB I doubt that matters.
HEre is how i would have done it in the past...
[quote]Dim dgi as DataGridItem
For Each dgi in DGWeek.Items
'Read in the Primary Key Field
Dim id as Integer = DGWeek.Items.DataKeys(dgi.ItemIndex))
Dim Tithe as Currency = dgi.FindControl("txtTithe"), TextBox).Text
Dim Education as Currency = dgi.FindControl("txtEducation"), TextBox).Text

'Issue an UPDATE statement...
Dim updateSQL as String = "UPDATE Tithe SET Tithe = @Tithe, " & _
"Education = @Education WHERE TRID = @TRID"
SqlQuery.Parameters.Clear()
SqlQuery.Parameters.Add("@Tithe", Tithe)
SqlQuery.Parameters.Add("@Education", Education)

SqlQuery.ExecuteNonQuery()
Next</CODE>