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

  • Home
  • SEARCH
  • 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 8077741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:33:51+00:00 2026-06-05T15:33:51+00:00

After I click update in the grid view, the code works successfully. But when

  • 0

After I click update in the grid view, the code works successfully. But when I retrieve the data in another webpage the columns I updated are blank. I have no clue why this happens.
Here is the code for both updating and displaying:
this is for updating

 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
         string v =     System.Configuration.ConfigurationManager.ConnectionStrings["harish"].ConnectionString;
         con = new OracleConnection(v);
         con.Open();

         string query = "update leave_module1 set name='"+GridView1.Rows[e.RowIndex].Cells[0].Text+"'";
         OracleCommand cmd = new OracleCommand(query, con);
         cmd.ExecuteNonQuery();
         ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('The Data has been added');</script>;");
         GridView1.EditIndex = -1;
         con.Close();    
}

and this the loadgrid()

   protected void loadgrid()
{

     string v = System.Configuration.ConfigurationManager.ConnectionStrings["harish"].ConnectionString;
        con = new OracleConnection(v);
        con.Open(); 
        cmd = new OracleCommand("select *  from leave_module1 where '"+TextBox1.Text+"' between fd and td", con);
        dr = cmd.ExecuteReader();

        GridView1.DataSource=dr;
        GridView1.DataBind();
        con.Close();
        dr.Close();

}
  • 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-05T15:33:53+00:00Added an answer on June 5, 2026 at 3:33 pm

    These are the might be possible solutions or part of the whole solutions that I think would be helpful:

    • Check that loadgrid() isn’t called before row_updating event because it will then cause the grid to lose changes and come back to normal view..
    • Also check n understand from this link: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowupdating.aspx
    • Don’t keep sql query or connection string name coded in page behind, instead use stored procedure or use some class containing string constants accessible which are thru out solution.
    • Always use sql parameter and stop using string concats because it will cause sql infection issues.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one grid view with 4 columns(UserId,Description,Password,Change Password[Button]). When i click on change
I have simple html code that plays YouTube video after click on the image:
For some reason, this configuration of an ExtJS4 grid won't update. When you click
i get the following when i click update after unchecking the full time box.
I try to start an action after click on the button in my alterView
$().ready(function(){ $(#move-to).click(function(){ $(body).bind(click,function(){ alert(foo); }); }); }); Why I see alert(foo) immediately after click
I try to play jpg (in loop), after click mp4 should be played after
I'm creating a Tic tac toe game, in that after click made by user
I'm using jQuery BlockUI Plugin and I'd like to do Javascript:history back(); after Click
I want to call setTimeout() after a click occurs. If the user clicks again

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.