I have a large web form - with 35 different textboxes, radiobuttons, drop-downs etc on it. I've written code to automatically parse through the controls on the page when it's submitted, and put all the values entered by the user into a string (could easily be an array of course). The problem I now have is whether there is any way to somehow automate this "string of values" being entered into the sql string (or stored procedure) to be sent to the database. Or am I going to have to write it all out as follows:
(CommandObj.Parameters.Add( "@FirstName", FirstName))
(CommandObj.Parameters.Add( "@Surname", Surname))
etc
Surely there must be a way to loop through the string, each time adding the value to the procedure, and not have to hard-code it 35 times? (I build a lot of similar forms and it would be nice to automate it somehow). If it can't be done with a stored procedure, then perhaps with a plain sql statement?
Thanks for any help 