Well, provided autopostback="true" on the dropdown, then in the selectedindexchanged event, put code in there that retrieves the name and occupation from the database, then assign those values to the textbox.
sub ddl_selectedindexchange(..)
'ADO.NET code to get data from database based on ID
'with Stored Proc or sql query method
'Get to datatable level (or can change to be a dataset)
if (myTable.Rows.Count > 0) then
Dim objRow As DataRow = myTable.Rows(0)
'If you have a datarow, do this to assign to textbox:
txtName.Text = objRow("Name").ToString()
txtOccupation.Text = objRow("Occupation").ToString()
end sub
HTH,
Brian
|