I have only been programming with asp.net for a week now, so I have lots of questions.
I am using the FormView control to create a form with a number of different type of form elements.
I’m adding the form elements one at a time and testing my insert so that if something doesn’t work, I can identify the form element causing trouble.
My first two form elements were drop down lists and work fine. Now I’ve added a ListBox where the user can select multiple items from the list. This form element is optional, so in my stored procedure I have set the parameters value to default to null in case the user skips this form element. It is expected that the user will select 0-3 itmes from this list, so I wrote 3 parameters in the stored proc to handle incoming choices from the list.
Now when I submit the form, no matter whether I choose any items or not from the listbox, I get this error message:
‘Procedure or function sp_GPRA_InsertActivity has too many arguments specified.’
At this point I have 6 parameters declared in my stored proc and 6
I am wondering how the asp engine handles the submital for items from a list box? Since I am using FormView there is no code behind for me to look at to see how things are being processed for me. As a classic .asp programmer this is frustrating for me because I feel like I don’t know what’s going on behind the scenes.I have searched the internet high and low for anything on how ListBox selections are sent as parameters and I can’t find a thing.
Any ideas are greatly appreciated.