Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. return value wont save

return value wont save

Scheduled Pinned Locked Moved ASP.NET
helpcareer
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    baselanfouqa
    wrote on last edited by
    #1

    hi all, i have a showmodaldialog and after getting value from B page the value is stored in textbox now everything is ok but save button wont take new value and returns the old one, is there something i should do, i will put the code of save button maybe it would help :- SqlConnection con = new SqlConnection(sConnectionString); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; if (ViewState["Edit"].ToString().Equals("Edit")) { cmd.CommandText = "BaselAnfouqa_Upd"; cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = nUserID; } else { cmd.CommandText = "BaselAnfouqa_Ins"; } cmd.Parameters.Add("@UserName", SqlDbType.VarChar, 50).Value = tbUserName.Text; cmd.Parameters.Add("@Password", SqlDbType.Int).Value = tbPassword.Text; cmd.Parameters.Add("@Salary", SqlDbType.Float).Value = tbSalary.Text; cmd.Parameters.Add("@Gender", SqlDbType.Char, 10).Value = ddlGender.SelectedValue; cmd.Parameters.Add("@DateOfBirth", SqlDbType.DateTime).Value = tbDateOfBirth.Text.ToString(); cmd.Parameters.Add("@Status", SqlDbType.Int).Value = ddlStatus.SelectedValue; con.Open(); cmd.ExecuteNonQuery(); vBindgvClients(); mvMainPage.SetActiveView(viewClients); thx in advance.

    V A 2 Replies Last reply
    0
    • B baselanfouqa

      hi all, i have a showmodaldialog and after getting value from B page the value is stored in textbox now everything is ok but save button wont take new value and returns the old one, is there something i should do, i will put the code of save button maybe it would help :- SqlConnection con = new SqlConnection(sConnectionString); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; if (ViewState["Edit"].ToString().Equals("Edit")) { cmd.CommandText = "BaselAnfouqa_Upd"; cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = nUserID; } else { cmd.CommandText = "BaselAnfouqa_Ins"; } cmd.Parameters.Add("@UserName", SqlDbType.VarChar, 50).Value = tbUserName.Text; cmd.Parameters.Add("@Password", SqlDbType.Int).Value = tbPassword.Text; cmd.Parameters.Add("@Salary", SqlDbType.Float).Value = tbSalary.Text; cmd.Parameters.Add("@Gender", SqlDbType.Char, 10).Value = ddlGender.SelectedValue; cmd.Parameters.Add("@DateOfBirth", SqlDbType.DateTime).Value = tbDateOfBirth.Text.ToString(); cmd.Parameters.Add("@Status", SqlDbType.Int).Value = ddlStatus.SelectedValue; con.Open(); cmd.ExecuteNonQuery(); vBindgvClients(); mvMainPage.SetActiveView(viewClients); thx in advance.

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      where is the code that is suppose to store the value when the button is Clicked

      Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

      B 1 Reply Last reply
      0
      • B baselanfouqa

        hi all, i have a showmodaldialog and after getting value from B page the value is stored in textbox now everything is ok but save button wont take new value and returns the old one, is there something i should do, i will put the code of save button maybe it would help :- SqlConnection con = new SqlConnection(sConnectionString); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; if (ViewState["Edit"].ToString().Equals("Edit")) { cmd.CommandText = "BaselAnfouqa_Upd"; cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = nUserID; } else { cmd.CommandText = "BaselAnfouqa_Ins"; } cmd.Parameters.Add("@UserName", SqlDbType.VarChar, 50).Value = tbUserName.Text; cmd.Parameters.Add("@Password", SqlDbType.Int).Value = tbPassword.Text; cmd.Parameters.Add("@Salary", SqlDbType.Float).Value = tbSalary.Text; cmd.Parameters.Add("@Gender", SqlDbType.Char, 10).Value = ddlGender.SelectedValue; cmd.Parameters.Add("@DateOfBirth", SqlDbType.DateTime).Value = tbDateOfBirth.Text.ToString(); cmd.Parameters.Add("@Status", SqlDbType.Int).Value = ddlStatus.SelectedValue; con.Open(); cmd.ExecuteNonQuery(); vBindgvClients(); mvMainPage.SetActiveView(viewClients); thx in advance.

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Put a breakpoint on the line here, and inspect what is the value of the Textbox in the server side. Does it have the latest values ? Does it have anything to deal with This ??[^] :confused:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        1 Reply Last reply
        0
        • V Vimalsoft Pty Ltd

          where is the code that is suppose to store the value when the button is Clicked

          Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

          B Offline
          B Offline
          baselanfouqa
          wrote on last edited by
          #4

          shown at 1st question page

          V 1 Reply Last reply
          0
          • B baselanfouqa

            shown at 1st question page

            V Offline
            V Offline
            Vimalsoft Pty Ltd
            wrote on last edited by
            #5

            what is "BaselAnfouqa_Upd" ?

            Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

            B 1 Reply Last reply
            0
            • V Vimalsoft Pty Ltd

              what is "BaselAnfouqa_Upd" ?

              Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

              B Offline
              B Offline
              baselanfouqa
              wrote on last edited by
              #6

              :) its a stored procedure

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups