Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7788109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:53:21+00:00 2026-06-01T20:53:21+00:00

The following code runs successfully with no errors, but I still don’t get the

  • 0

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?

 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='" & drplist.SelectedValue & "', passno='" & passportNumber.Text.Trim() & "', passexp='" & expiry.Text.Trim() & "', passtype='" & type.Text.Trim() & "', nameonpass='" & name.Text.Trim() & "', namelast='" & last.Text.Trim & "'  where cinvnum='" & cinvnum.Text.Trim() & "'", Conn) ' where cinvnum='" & grvSample.Rows(e.RowIndex) & "'")

    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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:53:23+00:00Added an answer on June 1, 2026 at 8:53 pm

    I assume that you’re databinding the GridView also on postbacks. That would override the changed values.

    So check it in Page_Load in the following way:

    If Not Page.IsPostBack Then
        BindGrid()
    End If
    

    Apart from that GridViewUpdateEventArgs contains a dictionary with NewNalues.

    Dim passportNumber = e.NewValues("passno")
    

    Note that they’re also overridden on databind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code runs fine under Magento 1.6 but raises a Mage_Core_Exception (message: 'Cannot
The following piece of code runs fine when parallelized to 4-5 threads, but starts
I create a new thread that runs the following code: public static void startServer()
Whenever the following code runs i get extra output on the page which looks
I have the following code: $bind = new COM(LDAP://CN=GroupName,OU=Groups,OU=Division,DC=company,DC=local); When I execute it from
I have a C code which successfully runs under ubuntu, but when I am
i've got the following code which runs a bat file. the bat file then
I have the following jQuery code which runs when I'm clicking an option in
I have the following SQL code that runs against a Change Request database. Each
The following code works & runs perfectly. public class Complex { private int real,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.