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. General Programming
  3. Visual Basic
  4. Insert values into SQL database from webform

Insert values into SQL database from webform

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasesql-serversysadmin
5 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
    BORN again
    wrote on last edited by
    #1

    Hello, I am designing an accounts webform( Crikey! ) in which I have two fields 'rate' in textbox1 and 'points' in textbox2 which are of type decimal in the first half of the webform. The user enters the values in these text boxes from the webform and on hitting a button 'calculate & display' following things should happen: 1. In textbox3 - result (type decimal) it should display the result (rate)-(points) which I have achieved :) 2. the user then enters the rest of the form and hits 'save form'. which means i have two buttons on the form,'calculate&display' and 'save' 3. On hitting save, it should save all the values on the webform into my (SQL server) database --- this is not working, it saves all of the other fields except these 3 text box values i.e. 'rate', 'points' and 'result', all that the database is saving each time is '0.00000' and '1.00000' can someone please help me with this ... cansome give me a quickie tour of how to calculate values on webform , display the result and save the rsult in database because i need to do a lot of this in the rest of the form. I have 6 more fields which I need to compare, calculate,display and save in database !!! I use Vb.net code but C# is welcome too. Thanks a Zillion in advance...it is going to be big help!!! Aartee. ...HE is watching Us All!

    T E 2 Replies Last reply
    0
    • B BORN again

      Hello, I am designing an accounts webform( Crikey! ) in which I have two fields 'rate' in textbox1 and 'points' in textbox2 which are of type decimal in the first half of the webform. The user enters the values in these text boxes from the webform and on hitting a button 'calculate & display' following things should happen: 1. In textbox3 - result (type decimal) it should display the result (rate)-(points) which I have achieved :) 2. the user then enters the rest of the form and hits 'save form'. which means i have two buttons on the form,'calculate&display' and 'save' 3. On hitting save, it should save all the values on the webform into my (SQL server) database --- this is not working, it saves all of the other fields except these 3 text box values i.e. 'rate', 'points' and 'result', all that the database is saving each time is '0.00000' and '1.00000' can someone please help me with this ... cansome give me a quickie tour of how to calculate values on webform , display the result and save the rsult in database because i need to do a lot of this in the rest of the form. I have 6 more fields which I need to compare, calculate,display and save in database !!! I use Vb.net code but C# is welcome too. Thanks a Zillion in advance...it is going to be big help!!! Aartee. ...HE is watching Us All!

      T Offline
      T Offline
      tatchung
      wrote on last edited by
      #2

      have you tried changing the type of ur results? Aim small, miss small...

      B 1 Reply Last reply
      0
      • T tatchung

        have you tried changing the type of ur results? Aim small, miss small...

        B Offline
        B Offline
        BORN again
        wrote on last edited by
        #3

        Hi tatchung, I don't quite understand what exactly you mean by changing the type of results but everything is in decimal...even if i try it in type Int or varchar etc... it still does not work, it is calculating and displaying the correct subtracted values but only on the webform, not saving it in the database. Aartee. ...HE is watching Us All! -- modified at 22:26 Sunday 18th September, 2005

        T 1 Reply Last reply
        0
        • B BORN again

          Hi tatchung, I don't quite understand what exactly you mean by changing the type of results but everything is in decimal...even if i try it in type Int or varchar etc... it still does not work, it is calculating and displaying the correct subtracted values but only on the webform, not saving it in the database. Aartee. ...HE is watching Us All! -- modified at 22:26 Sunday 18th September, 2005

          T Offline
          T Offline
          tatchung
          wrote on last edited by
          #4

          Good day sir, I mean have you tried checking the value u are returning in ur insert command? is it of type decimal? i've had a similar problem with a short once and all i did was declared the value in my insert command. might work on ur problem but then again i could be wrong...im still a beginer u know:-O Aim small, miss small...

          1 Reply Last reply
          0
          • B BORN again

            Hello, I am designing an accounts webform( Crikey! ) in which I have two fields 'rate' in textbox1 and 'points' in textbox2 which are of type decimal in the first half of the webform. The user enters the values in these text boxes from the webform and on hitting a button 'calculate & display' following things should happen: 1. In textbox3 - result (type decimal) it should display the result (rate)-(points) which I have achieved :) 2. the user then enters the rest of the form and hits 'save form'. which means i have two buttons on the form,'calculate&display' and 'save' 3. On hitting save, it should save all the values on the webform into my (SQL server) database --- this is not working, it saves all of the other fields except these 3 text box values i.e. 'rate', 'points' and 'result', all that the database is saving each time is '0.00000' and '1.00000' can someone please help me with this ... cansome give me a quickie tour of how to calculate values on webform , display the result and save the rsult in database because i need to do a lot of this in the rest of the form. I have 6 more fields which I need to compare, calculate,display and save in database !!! I use Vb.net code but C# is welcome too. Thanks a Zillion in advance...it is going to be big help!!! Aartee. ...HE is watching Us All!

            E Offline
            E Offline
            Edbert P
            wrote on last edited by
            #5

            all that the database is saving each time is '0.00000' and '1.00000' You might have referenced the wrong control, or you are losing the control handle on postback of the page. If you can give a small sample code containing your Textboxes and Database update we might be able to help you more on this. Ed -- modified at 3:03 Monday 19th September, 2005 [Edit]Also, posting in ASP.Net forum might be better.[/Edit]

            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