Symptoms
I have a smartobject for searching SQL server DB through a SmartObject method. I want to pass the selected items from a multi select checkbox as parameters to the SMO and consequently to the SQL Server SP. But as I check the underlying query in SQL Profiler I see (as below) that the check box selected items are passed as a big chunk of XML. Is there a better way to deal with that so that only the Value/Key of the selected items are passed?
exec edbo].otable_name]
@ActionCode='<collection><object parentid="xxxx-xxx-xxx-xxx" parenttype="Object">
<fields>
<field name="Item_name"><value>0</value></field>
<field name="Item_name"><value>1</value></field>
<field name="Item_name"><value>2</value></field>
</fields></object></collection>'
Diagnoses
This behavior is expected when using a Checkbox List control.
Resolution
If you use a "Choice Control" instead and select the "Check Box List" display option it will store the data as a comma separated list instead, but will still behave like a Check Box List. I.e. "0;1;2"
Please see the documentation for this control below:
http://help.k2.com/onlinehelp/k2smartforms/controlpack/1.0/default.htm_Input Controls/Choice.html