Retrieve field from SQLDataSource selected in bound DropDownList
Posted on 2013-01-23
I have an ASP.Net web application and have a drop down list which is bound to a SQLDataSource (SQL: SELECT ID, FileName, FileLocation FROM FILES). FileName is the display member in the list
When the user selects an item in the list I want to retrieve a the FileLocation and display it in a text box. How can I get this value from the selected item in the DataSource? I'm hoping I don't have to do another SQL query.
The user can change this displayed FileLocation and update it in the DB by clicking a Save button. Can I update the SQLDataSource directly?