Changing drop down select stmt

D

David

I cannot get a simple changing of a SelectCommand for a SqlDataSource used
in a drop-down list to work. If I do the same process to my GridView
SqlDataSource it works fine. Can anyone help? I am using the simple line
of code (below) at the top of the aspx web page:

'SqlIssue.SelectCommand = "SELECT 0 As issue_seq_nbr, '--- Not Selected ---'
As issue_display UNION SELECT " & intid & " As issue_seq_nbr, '" &
dtra("issue_name") & "' As issue_display UNION SELECT [issue_seq_nbr],
[issue_display] FROM [vw_IssuePick] WHERE [active]=1 ORDER BY
[issue_display]"

I only want to change the command if the record I am opening is active (a
boolean column). If I use the command above, I get the error "Databinding
methods such as Eval(), XPath(), and Bind() can only be used in the context
of a databound control."

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top