473,470 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to make a result in a query(with var.) as an var in ASP.NET?

sorry,i am very very to ASP.NET
now ,i need to make 2 funtions on an ASP.NET c# page working with an SQL server (using Visual Web Developer 2010 Express)

the 1st one is a simple serach and i've done

the 2nd thing is an update , the sp is like:(it works in SQL)

Expand|Select|Wrap|Line Numbers
  1. UPDATE [lens] SET [qty] = @b+@c WHERE [id] = @a
@a is the id which user input in the textbox1
@b is an number user input in the textbox2
now @c should be the result of an query "select [qty] from [lens] where [id] = @a"

so ,the new value of [qty] will be the "old valus"+"valus in textbox2"

can someone tell me how can i do that?
Oct 31 '10 #1
2 1632
Frinavale
9,735 Recognized Expert Moderator Expert
Please review the following articles that outline how to use a database:
Database tutorial Part 1
Database tutorial Part 2
Nov 1 '10 #2
You need to add the new value to existing value.. rite?

then use this query.

UPDATE [lens] SET [qty] = [qty]+@b WHERE [id] = @a
Nov 5 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Lowell Kirsh | last post by:
I have a script which I use to find all duplicates of files within a given directory and all its subdirectories. It seems like it's longer than it needs to be but I can't figure out how to shorten...
31
by: JS | last post by:
We have the same floating point intensive C++ program that runs on Windows on Intel chip and on Sun Solaris on SPARC chips. The program reads the exactly the same input files on the two platforms....
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
7
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
3
by: warezguy05 | last post by:
hi im pretty new in php (and programming at all), but for a project at school i need to make a festival-site where volunteers can sign up to work at a festival and those people can be 'reserved'...
5
by: Grant Merwitz | last post by:
I have a basic object in an array. I bind this class to a gridview. How can i make this class sortable? Here's an example class public class MyClass { public MyClass(classname, classtype)
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
0
by: Chocolade | last post by:
Ok here are the codes of the two events. In the second event im using int veriable to count each time the event is raised. The problem is that when the first event is raised also the second one...
1
by: DavidSS | last post by:
I just started programming, and I followed a tutorial to make a calculator. Once I was done, I wanted to make it more advanced, so it wouldn't crash if I try to divide by 0, but instead not giving me...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.