这是我填充下拉列表的代码:
For i = 1 To Convert.ToInt32(count1)
etc.CommandText = "select Classification from schemaItemDetails.AssetCategory where ASC_ID = " & i & ""
Dim dra1 As SqlDataReader = etc.ExecuteReader
While (dra1.Read())
ddonecategory.Items.Add(dra1.GetString(0))
End While
dra1.Close()
Next
如何设置下拉列表的文本?因为当我使用此代码设置下拉列表的文本时:
ddonecategory.Text = "Toolings".Text
我收到这种错误:
'ddonecategory' has a SelectedValue which is invalid because it does not exist in the list of items.