Hey All,
I am trying to update the data using adatagrid control, but i have a problem. Basically, when i press the edit and the text boxes show up with the data, i chage the data in any of them, but when i press update, nothing changes. I used the debugger and i noticed that simply the cell content do not change (i.e. stick back to the orginal values of the cell). Here is the code:
Code:
Private Sub articlesDG_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles articlesDG.UpdateCommand
Dim myID, authorNew, thisAuthor, subject, category As TextBox
Dim try1, try2, try3, try4 As TextBox
'variables used during debugging
thisAuthor = CType(e.Item.FindControl("Author"), TextBox)
try1 = e.Item.Cells(2).Controls(0)
try2 = e.Item.Cells(3).Controls(0)
myID = e.Item.Cells(2).Controls(0)
Dim SQLstr As String
SQLstr = "Update articles set Author='" & thisAuthor.Text & "' where articleID = " & myID.Text
inventory.updateArticleData(SQLstr)
articlesDG.EditItemIndex = -1
articlesDG.DataBind()
End Sub
I appreciate your help.
Hany
Regards,
Hany