473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

need advice

Hi, I have 2 textboxses on asp.net page

textbox=description, textbox2=quantity

What I want when I enter values for them it stored temporarily or smth. like
that and then when I click order button it should submit it to SQL Server
(order, orderdetails)

it is like shopping basket bit without products. I enter products manually
(discription and quantity) and then click add. So I want to add many
orderdetails to single order

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
SqlConnection1.Open()
SqlCommand1.CommandText = "NewOrder"

SqlCommand1.CommandType = CommandType.StoredProcedure

Dim p As New SqlClient.SqlParameter()

p.ParameterName = "@empID"

p.Direction = ParameterDirection.Input

p.SqlDbType = SqlDbType.Int

p.Value = 1

SqlCommand1.Parameters.Add(p)

p = New SqlClient.SqlParameter()

p.ParameterName = "RETURN"

p.Direction = ParameterDirection.ReturnValue

p.SqlDbType = SqlDbType.Int

SqlCommand1.Parameters.Add(p)

SqlCommand1.ExecuteScalar()

Dim RFID As Integer = CType(SqlCommand1.Parameters("RETURN").Value, Integer)

SqlCommand1.CommandText = "NewOrderLine"

SqlCommand1.CommandType = CommandType.StoredProcedure

SqlCommand1.Parameters.Clear()

p = New SqlClient.SqlParameter()

p.ParameterName = "@RFID"

p.Direction = ParameterDirection.Input

p.SqlDbType = SqlDbType.Int

p.Value = RFID

SqlCommand1.Parameters.Add(p)

p = New SqlClient.SqlParameter()

p.ParameterName = "@Description"

p.Direction = ParameterDirection.Input

SqlCommand1.Parameters.Add(p)

p = New SqlClient.SqlParameter()

p.ParameterName = "@quantity"

p.SqlDbType = SqlDbType.Int

SqlCommand1.Parameters.Add(p)
'add order

p = SqlCommand1.Parameters("@description")

p.Value = TextBox1.Text

p = SqlCommand1.Parameters("@quantity")

p.Value = TextBox3.Text

SqlCommand1.ExecuteNonQuery()

SqlConnection1.Close()

End Sub
Nov 18 '05 #1
1 979
Thanks Alvin,
Can you please give me small code example, if possible

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:ur****************@TK2MSFTNGP12.phx.gbl...
If i understand you correctly, the best way forward would be to have a
submit button. This button takes the input of the text boxes and stores it
in an arraylist so the user can keep on submitting. When they are done, use another button to loop thru the array list of items building the parameters for the query. See if that helps.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Ramin" <ra***@iatp.az> wrote in message
news:eg**************@TK2MSFTNGP10.phx.gbl...
not yet

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Ramin" <ra***@iatp.az> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
> Hi, I have 2 textboxses on asp.net page
>
> textbox=description, textbox2=quantity
>
>
>
> What I want when I enter values for them it stored temporarily or smth. like
> that and then when I click order button it should submit it to SQL

Server
> (order, orderdetails)
>
> it is like shopping basket bit without products. I enter products

manually
> (discription and quantity) and then click add. So I want to add many > orderdetails to single order
>
>
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
>
> SqlConnection1.Open()
>
>
> SqlCommand1.CommandText = "NewOrder"
>
> SqlCommand1.CommandType = CommandType.StoredProcedure
>
> Dim p As New SqlClient.SqlParameter()
>
> p.ParameterName = "@empID"
>
> p.Direction = ParameterDirection.Input
>
> p.SqlDbType = SqlDbType.Int
>
> p.Value = 1
>
>
>
> SqlCommand1.Parameters.Add(p)
>
> p = New SqlClient.SqlParameter()
>
> p.ParameterName = "RETURN"
>
> p.Direction = ParameterDirection.ReturnValue
>
> p.SqlDbType = SqlDbType.Int
>
> SqlCommand1.Parameters.Add(p)
>
> SqlCommand1.ExecuteScalar()
>
>
>
> Dim RFID As Integer = CType(SqlCommand1.Parameters("RETURN").Value,
Integer)
>
> SqlCommand1.CommandText = "NewOrderLine"
>
> SqlCommand1.CommandType = CommandType.StoredProcedure
>
> SqlCommand1.Parameters.Clear()
>
> p = New SqlClient.SqlParameter()
>
> p.ParameterName = "@RFID"
>
> p.Direction = ParameterDirection.Input
>
> p.SqlDbType = SqlDbType.Int
>
> p.Value = RFID
>
> SqlCommand1.Parameters.Add(p)
>
> p = New SqlClient.SqlParameter()
>
> p.ParameterName = "@Description"
>
> p.Direction = ParameterDirection.Input
>
> SqlCommand1.Parameters.Add(p)
>
> p = New SqlClient.SqlParameter()
>
> p.ParameterName = "@quantity"
>
> p.SqlDbType = SqlDbType.Int
>
> SqlCommand1.Parameters.Add(p)
>
>
> 'add order
>
> p = SqlCommand1.Parameters("@description")
>
> p.Value = TextBox1.Text
>
> p = SqlCommand1.Parameters("@quantity")
>
> p.Value = TextBox3.Text
>
> SqlCommand1.ExecuteNonQuery()
>
>
>
> SqlConnection1.Close()
>
> End Sub
>
>



Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andy | last post by:
Hello All, I'm currently getting into ASP and need some advice on any particular books or tutorials or websites that you can recommend so that I can get a good foundation on ASP as well as...
11
by: Mark | last post by:
Hi, For the last 2 years I've been developing vehicle tracking/telemetric software for a company as a self employed individual. The project is quiet big, and is going to be there flagship...
2
by: andyjgw | last post by:
Hi I'm a bit new to the designing of custom web page controls and using them in the properties designer window - need a little advice on a concept here. I have two properties in my control -...
1
by: Chris Lane | last post by:
Need Advice on prebuilt Exception Assemblies Please take a look at my post on the Titled: Need Advice on prebuilt Exception Assemblies posted on 04/21/04 Thank
3
by: Sigmathaar | last post by:
Hi, I'm need some advice about lists and vectors. I'm doing a program who needs to have sequential access of a non ordered unit of objects whose size decreases almost each time the sequence is...
4
by: Web_PDE_Eric | last post by:
I don't know where to go, or what to buy, so plz re-direct me if I'm in the wrong place. I want to do high performance integration of partial differential eqns in n dimensions (n=0,1,2,3..etc) I...
9
by: laststubborn | last post by:
Dear All, We have a big concern in our Database system. We have 2000 transactions daily in our database. We need to replicate some how the database for our fail over setup. I tried transactional...
7
by: John Paul | last post by:
I'm thinking of building an e-commerce site in php. Anyone got any advice in building one? What is the best way to implement a payment system? Are any legal issues involved? Thanks,
51
by: cool_ratikagupta | last post by:
hello friends i ha just started learning c can u all give me the tips to make myself strong in c lanuage . as i want to be the best in watever i do . so just a request from all of u here plz help...
7
by: SM | last post by:
Hello, I have a index.php template (2 columns). The right columns contains a bunch of links (interviews, poems, etc...) The left columns contains the actual article. So if I click on a link on...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
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...

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.