SqlDataSource and dropdown

  • Thread starter Thread starter Simone
  • Start date Start date
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
 
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.
 
Back
Top