If understand correctly, what you need is:
- Define new query for custom table
-
Create your custom query according to guidelines. It should be something similar to:
SELECT CustomTableIdFieldName, CustomTableValueFieldName
FROM customtable_sampleTable
WHERE ##WHERE##
ORDER BY ##ORDERBY##
-
Add New Query Data Source to your page template and point it to your query
- Add basic repeater to generate your drop down, point it your query data source.
-
Define a transformation that your repeater that will use.
<option value="<%# Eval("CustomTableIdFieldName") %>">Eval("CustomTableValueFieldName")</option>
-
Add <select></select>
tags to content before and after of your repeater
Your repeater now should render a drop down :)
P.S. There is also a shorter way without defining query, you can use custom table repeater. You can find the example under /Examples/Web-parts/Custom-tables/Custom-table-repeater.aspx on Corporate Site exmample. You just need to define transformation and add <select>
to content before and after