Hi,
in your ItemDataBound of your ListView, do this please:
Protected Sub ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewCommandEventArgs) Handles ListView1.ItemCommand
Dim tb1, tb2, tb3 As TextBox
Dim ddl1 As DropDownList
tb1 = CType(e.Item.FindControl("txtpkey"), TextBox)
tb2 = CType(e.Item.FindControl("txthaulkey"), TextBox)
tb3 = CType(e.Item.FindControl("txtmileage"), TextBox)
ddl1 = CType(e.Item.FindControl("editsurfaceddl"), DropDownList)
If e.CommandName = "Update" Then
Dim Mystrsql As String = "UPDATE rmfhaulsurface SET Surface = '"
Mystrsql &= ddl1.Text & "', Mileage = '" & tb3.Text.Trim
Mystrsql &= "' WHERE pkey = " & tb1.Text
haulsurfacedata.UpdateCommand = Mystrsql
……………………………………
ElseIf e.CommandName=="Edit" Then
ListView1.EditIndex = e.Item.ItemIndex;
ListView1.DataBind();
………………
Hope it helps you.