Hi, Consider, you are having user table named "
AllUsers" as follows,
UserId | UserName | PhoneNumber | Address |
User1 | John | 4567891234 | Xyz |
User2 | David | 9987123456 | Abc |
User3 | Richard | 8529784562 | Def |
Now just select the UserName from the table using the following query,
Select UserName from AllUsers
It will returns the list of UserNames. Bind this to your DropDown List.
And Now, When your are selecting an user from dropdown menu, you will have a single UserName, store it to a string property like
SelectedUser. In this case, consider the
SelectedUser as
John.
Then use the following query to get the details about
John,
Select * from AllUsers Where UserName='John'
It returns the entire row like the following,
UserId | UserName | PhoneNumber | Address |
User1 | John | 4567891234 | Xyz |