I created a web form and In the web form, there is a multiselect dropdownlist. I am getting value from multiselect dropdownlist and passing it to hidden field. Then i am adding hidden field's value to SqlCommand as a parameter. As it is understood i have a query and the parameter is using with 'IN' clause in the query.
When i select only one option, it is working smoothly and i can get the dataset.but when it is selected multiple.it is returning no result.
Query:
select .... from tblReservation
Where type IN (@type)
Code:
command.Parameters.Add(new SqlParameter("@type", HiddenField.Value));
When one option is selected HiddenField.Value="flight"
When multiple options is selected HiddenField.Value="flight,Hotel,rentacar"