code as follows:
Dropdownlist1.datasource = Listsort;
Dropdownlist1.datatextfield = "Logsortname";
Dropdownlist1.datavaluefield = "Logsortid";
Dropdownlist1.selectedindex = DDL. Items.indexof (DropDownList1.Items.FindByValue ("I"));
I want to get the ID of the item you want to display.
Method Two: I put a part of the code
After you get the data, match the item you want based on that value.
But it should be a little more convenient to change the for to Do...while in the picture.
In fact, the idea of two methods are the same, is to get ID to match ...