SqlDataSource and dropdown

S

Simone

Hello, I am new to asp.net and I am in need of help.

I have a dropdown that is attached to a SqlDataSource (DataSourceID).
The dropdown has one column shown as text and another hidden as the
value. However my SqlDataSouce returns 3 columns but I am only using
two for the dropdown (value,text) but the third column I would like to
place it in a textbox.

So,
SqlDataSource has (three columns "A, B, C") it populates a dropdown
with A and B. On SelectedIndexChanged of the dropdown I want to
populate the a textbox with the third column "C".

something like textbox.text = sqldatasoure. ("something here")

How do I do that?

Can a sqldatasource populate a textbox? If it can, what is the syntax.

Thank you.
Your help is much appreciated.

-Simone
 
E

Eliyahu Goldin

Don't use SqlDataSource. Download the data to a dataset and databind the ddl
to the dataset. In the SelectedIndexChanged event locate the selected row in
the datatable and get the third value.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top