Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 22, 2007 08:15 PM by jezh
Nov 13, 2007 12:32 AM|LINK
You are going to have to read your location table in a loop, then have a hard-coded set of if statements, one after another, one for each location in the record.
Or, if you had a normalized location table per my suggestion, just a loop. :)
Nov 13, 2007 04:26 PM|LINK
well i have written something similar before (loop) that writes values to the db in the way i described but putting a loop inside a loop, so it loop through to the end of the line and then down one line etc. Apart from that though, how will i do this, im
still stuck :(
Nov 13, 2007 04:39 PM|LINK
Could you not get the code I suggested last time to work?
Nov 13, 2007 04:50 PM|LINK
no, sadly i couldn't at all, i tried doing it but got all confused and the real heart of it which was in the BLL i didnt get - if you had just a chunck of code which i could use and adapt thats what i really need, i just dont have the skills to write it
Nov 13, 2007 04:52 PM|LINK
Ok well Ramseys Kitchen Nightmares isn't on until 9:00 so I will have a look and see if I can come up with a simple to use example. So can you not change the structure of the database - its this that is causing all of the problems.
Nov 13, 2007 05:09 PM|LINK
well i suppose i could, but that table is used on a few other pages, the way i thought about it was (as i said in my earlier post) that just to put another loop inside the loop which make it count horizontally so it goes L1-1 L1-2 L1-3 etc then that loop
finishes and then onto L2-1 L2-2 L2-3 etc and so on until it reaches L5-5
Nov 13, 2007 07:21 PM|LINK
How about this for a start. Its best to get your database design doen correctly to start with otherwise you will always be fighting agains't it. Have you got the option to redesing the database?
Database Normalization Basics
If you did want to redesign you could ask for help on these forums.
If you decide you want to keep your exisitng design then I will give you a hand to get your application working... but I am sure you will hit more problems in the future so don't say we didn't warn you [;)]
Nov 13, 2007 07:29 PM|LINK
i did some database normalisation at uni and hated it! haha but i have to use is. The reason for the design like that is that one product can have parts to it. e.g pack 1, pack 2, and those can be in multiple locations, so when the user enters it, they enter
say the part title e.g. box 1 then list all the locations and qtys in that location, so it saves them having to list it out many times. I know i could normalise this, but it means more tables and l lot more programming - and with the trouble i have had to
get this working so far im not willing to take that chance! as im not that good at c# so you can see my problem
Nov 13, 2007 07:49 PM|LINK
Right let me find the code I posted for you....
Nov 13, 2007 10:38 PM|LINK
Ok how about something like this, I don't know if it will work but it seems to do all you want. Its not perfect but its a start and its all in one page as you wanted :0)
My page, you would have your 11 text boxes on here: