Is there a better way to pass more than 35 paramteres to a SQL Server stored procedure?
I have a web page consisting of more than 35 input controls (textboxes, dropdown lists, date pickers), and I need to pass all those to the stored procedure to insert those values into a table.
I am using current basic approach as shown below:
cmd.Parameters.Add("@SplProjectNum1", SqlDbType.VarChar).Value = txtPromptNumber;
cmd.Parameters.Add("@SplProjectNum2", SqlDbType.VarChar).Value = ProjectClosureDate.ToString();
cmd.Parameters.Add("@SplProjectNum3", SqlDbType.VarChar).Value = txtPromptNumber;
cmd.Parameters.Add("@SplProjectNum4", SqlDbType.VarChar).Value = txtPromptNumber;
cmd.Parameters.Add("@SplProjectNum5", SqlDbType.VarChar).Value = txtPromptNumber;
cmd.Parameters.Add("@SplProjectNum6", SqlDbType.VarChar).Value = txtPromptNumber;
...