I have a custom table and I am trying to pull the value "ItemName" into a dropdown selector from the table. But when I change my SQL query to SELECT ItemName, ItemName FROM Custom_Table ORDER BY ItemID I get no value. when I check the output the value is just listed as "0". If I change the select statement to SELECT ItemID, ItemName the values get populated as integers, but I need the values to appear as the ItemName not the ID. Can someone please tell me how I can get the 'ItemName' to populate in the value field?
SELECT ItemName, ItemName
FROM Custom_Table
ORDER BY ItemID
SELECT ItemID, ItemName
ItemName
I meant on the dropdown form control. My assumption was that you tried to pull all those data in dropdown on the Kentico form. In that case, datatype of that field (dropdown) in form should be Text.
Hi Jason,
Check data type field of your dropdown control. If data type of dropdown is integer, then all string values will be added as integer (default 0). You should change it to 'Text' to populate text value into dropdown.
Best regards, Dragoljub
Dragoljub, the data type for ItemName has been set to text when it was created, yet the value continues to return only 0s instead of their text names like desired
text
0
Dragoljub, thank you very much. Once I changed the data type for the dropdown, the values came over as desired. Thanks again!
Please, sign in to be able to submit a new answer.