title: VB.NET RowUpdating event doesn't work
body: <p>The following code runs successfully with no errors, but I still don't get the new data from the grid, by adding a break point, and stepping forward, the data in the variables are the original data, not the updated data, what am I missing?</p>
  
  <pre><code> Private Sub grvSample_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles grvSample.RowUpdating
      Dim row As GridViewRow = DirectCast(grvSample.Rows(e.RowIndex), GridViewRow)
      Dim passportNumber As TextBox = DirectCast(row.FindControl("txtNumber"), TextBox)
      Dim expiry As TextBox = DirectCast(row.FindControl("txtExpiry"), TextBox)
      Dim type As TextBox = DirectCast(row.FindControl("txtType"), TextBox)
      Dim name As TextBox = DirectCast(row.FindControl("txtName"), TextBox)
      Dim cinvnum As TextBox = DirectCast(row.FindControl("txtCINVNUM"), TextBox)
      Dim last As TextBox = DirectCast(row.FindControl("txtLast"), TextBox)
      Dim drplist As DropDownList = DirectCast(row.FindControl("DDLNat"), DropDownList)
  
      Dim Conn As New SqlConnection("Data Source=ADMIN-PC;Initial Catalog=T1INV;Integrated Security=True")
  
      Dim cmd As New SqlCommand("update pass_details set passnat='" &amp; drplist.SelectedValue &amp; "', passno='" &amp; passportNumber.Text.Trim() &amp; "', passexp='" &amp; expiry.Text.Trim() &amp; "', passtype='" &amp; type.Text.Trim() &amp; "', nameonpass='" &amp; name.Text.Trim() &amp; "', namelast='" &amp; last.Text.Trim &amp; "'  where cinvnum='" &amp; cinvnum.Text.Trim() &amp; "'", Conn) ' where cinvnum='" &amp; grvSample.Rows(e.RowIndex) &amp; "'")
  
      Try
          Conn.Open()
          cmd.ExecuteNonQuery()
          ' Refresh the data
          grvSample.EditIndex = -1
          Dim SSQL = "select * from pass_details"
          Dim ds As New DataSet("GET_HIS")
          Dim adp As New SqlDataAdapter(SSQL, Conn)
          adp.Fill(ds, "TAB_SMT")
          grvSample.DataSource = ds.Tables("TAB_SMT")
          grvSample.DataBind()
      Catch ee As SqlException
  
      Finally
          cmd.Dispose()
          Conn.Close()
          Conn.Dispose()
      End Try
  End Sub
  </code></pre>