hi there, i have 3 tables, tbl_stock, tbl_stock_location and tbl_del_location. the user will enter a stock id and qty onto the aspx page, the code then needs to select the record from tbl_stock_location - thats not a problem. what i am having real trouble
with is this.
in tbl_stock_location the fields are like this ID stock_id location1 qty1 location2 qty2 location3 qty3
======================================================
001 145 12 1 11 3 19 5
what it needs to do is to
<div mce_keep="true">take the qty entered by the user </div>
<div mce_keep="true">loop through tbl_location and add the qtys and location's to tbl_del_location each time subtracting the number in the qty field until qty_entered = 0</div>
<div mce_keep="true">then it needs to do the same again, but just update tbl_location (which would be deleteing the location e.g. making it = 0 when the qty was 0) </div>
there is more to do on this, but this part of it is the core and i am really struggling to do this, any help would be great. I am using .Net with C# and have never used BLL or DAL, i just want something simple in the code behiend file to do this, once its
up and running then i will seperate it.
Thanks in advance
Jez
Jeremy Huson
Senior Network Engineer
Carden Computers - PC Repair Brighton
jezh
Member
285 Points
510 Posts
reading from one table, writing to another in loop
Nov 10, 2007 05:35 PM|LINK
Senior Network Engineer
Carden Computers - PC Repair Brighton