I have three items in my checkbox list, what I want to do is for the user to select either one of them in any combination and pass these values to my sql server stored procedure which then returns data according to the values passed to it in the where clause
and binds this data to a gridview. However, at the moment in my sp I have three IN parameters, in the case of the user selecting one item from the list not enough arguments will have been passed to the procedure. I'm not sure how to go about doing this.
Rghanbar87
Member
6 Points
27 Posts
passing checkboxlist items to stored procedure
Jan 15, 2009 03:22 PM|LINK
What I'm trying to do is the following:
I have three items in my checkbox list, what I want to do is for the user to select either one of them in any combination and pass these values to my sql server stored procedure which then returns data according to the values passed to it in the where clause and binds this data to a gridview. However, at the moment in my sp I have three IN parameters, in the case of the user selecting one item from the list not enough arguments will have been passed to the procedure. I'm not sure how to go about doing this.
Can anybody help please?
Thanks in advance
dilvid
Member
66 Points
31 Posts
Re: passing checkboxlist items to stored procedure
Jan 15, 2009 09:51 PM|LINK
Could try
sqlcommmand.paramaters.addwithvalue("Check1",Check1.Checked); sqlcommmand.paramaters.addwithvalue("Check2",Check2.Checked); sqlcommmand.paramaters.addwithvalue("Check3",Check3.Checked);komakula
Member
325 Points
187 Posts
Re: passing checkboxlist items to stored procedure
Jan 16, 2009 07:32 PM|LINK
for checkboxlist
you should pass checkboxlist.selecteditem.value