Insert values into SQL database from webform
-
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!
-
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!
-
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
-
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
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...
-
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!
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]