Protected Sub DataList1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.UpdateCommand Dim AgentId As String = DataList1.DataKeys(e.Item.ItemIndex).ToString() DataList1.DataKeys(e.Item.ItemIndex).ToString() Dim Name As TextBox = CType(e.Item.FindControl("txtName"), TextBox) str = "" Try openConnection(con) str = "UPDATE Agent_Master SET A_Name='" & Name.Text & "'WHERE AgentId ='" & AgentId & "'" cmd = New OleDbCommand(str, con) cmd.ExecuteNonQuery() LoadData() DataList1.EditItemIndex = -1 Catch ex As Exception alert(MessageType.Fail) Finally con.Close() End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)