Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2006, 12:34 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default saving informations to table

hi all,

i am trying to develop a sample ecommerce aplication, in which i want your help in proceeding.

i am displaying shoping cart items in a datagrid, below the datagrid, i am displaying subtotal, tax, shippingcost,grand total like fields in lablels.

once the user finalises the items, and click to confirm order, i want the informations to be saved to an Order table.

how can i do that? using stored procedures?

can anyone please help me
thanks

 
Old December 12th, 2006, 12:38 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Isnt your cart already stored in a backend table?

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 12th, 2006, 12:41 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes, but the cart table has only productid, unitprice,quantity etc.
it is not containing subtotal, grand total(after tax and all)

 
Old December 12th, 2006, 01:04 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You can still figure the information out in SQL. You have the quantites and the product prices and you have hard coded your tax rate so moving the data from the cart to the order table would be no different. Just do all of the addition and such in a stored procedure and it should work fine.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 12th, 2006, 02:40 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how can i assign the values in datagrid, as the parametrs of stored procedure.
is there any way to do that?
i am displaying productid, unitprice,quantity in datagrid, these values, how can i take into stored procedure?

 
Old December 12th, 2006, 02:47 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No, not easily anyway. Since you will have a dynamic amount of items/quantities/prices in the datagrid it would be hard to write a stored procedure that could handle this. What you might end up doing is looping through your datagrid like this:

for each row in datagrid
get productid, unitprice,quantity for this row
populate a stored procedure
execute stored procedure
loop

So you write a stored procedure to handle just one item at a time but loop through each item in the grid.

I dont think that is very effecient and would probably choose to do it a different way but I do not know your infastructure so can't advise any other way.


-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 12th, 2006, 03:00 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes Mr.Parson, i also think that, i am complicating the matter.
i will try the way you suggested.ie, with the sql






Similar Threads
Thread Thread Starter Forum Replies Last Post
saving informations into databasw sarah lee SQL Server 2000 1 December 14th, 2006 03:18 PM
Saving data to a table through form input misskaos Classic ASP Basics 16 October 2nd, 2006 11:54 AM
saving table of information back into database mrjits Excel VBA 3 July 17th, 2006 01:42 PM
Saving a dataset to an Access table smego ADO.NET 0 June 2nd, 2004 01:19 AM
ROW-00060 I need some informations please !! WolFox Oracle ASP 1 October 12th, 2003 04:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.