SteveInBeloit
Well-known member
- Joined
- May 22, 2006
- Messages
- 132
- Programming Experience
- 10+
HI,
I have an ASP .NET page that collects warranty information, name, address, etc. I gather the info, validate it with validation controls, then call a Stored Proc on SQL 2005 passing the data as parameters that does the inserts.
Now I have to put check boxes on it for the users to check. 69 of them!! I don't want to add 69 more parameters to my stored proc. So, here is what I am thinking. I would like some input as to is this sounds OK, and how to do some of it.
Put all the check boxes on the page.
Add one parameter to the stored proc, a string. As I interrogate the checkboxes, build a string full of 1's and 0's (on and offs). Pass that to the proc, and let it sort them out. Yes, positions will be VERY important. Sound OK? Is there a way to do this in a loop, and not one at a time?
I have heard of the StringBuilder class, I will look that up, and hope it can help in building the string. Sound OK?
I will want a "Check All" button. If that is set, I will pass a string of all 1's (ons).
Is there a way to check all checkboxes on the page when they push this button? And a way to reset them all for the next user?
Thanks for any help thrown my way. I think I know what I want to do, just not 100% sure on how to do it.
Steve
I have an ASP .NET page that collects warranty information, name, address, etc. I gather the info, validate it with validation controls, then call a Stored Proc on SQL 2005 passing the data as parameters that does the inserts.
Now I have to put check boxes on it for the users to check. 69 of them!! I don't want to add 69 more parameters to my stored proc. So, here is what I am thinking. I would like some input as to is this sounds OK, and how to do some of it.
Put all the check boxes on the page.
Add one parameter to the stored proc, a string. As I interrogate the checkboxes, build a string full of 1's and 0's (on and offs). Pass that to the proc, and let it sort them out. Yes, positions will be VERY important. Sound OK? Is there a way to do this in a loop, and not one at a time?
I have heard of the StringBuilder class, I will look that up, and hope it can help in building the string. Sound OK?
I will want a "Check All" button. If that is set, I will pass a string of all 1's (ons).
Is there a way to check all checkboxes on the page when they push this button? And a way to reset them all for the next user?
Thanks for any help thrown my way. I think I know what I want to do, just not 100% sure on how to do it.
Steve