次のイベントハンドラーはそのリストを返していますが、明確ではありません。リストにはまだ多くの重複があります。何か考えはありますか?
Protected Sub ddlState_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlState.SelectedIndexChanged
If IsPostBack Then
ddlCity.Items.Clear()
Dim context As New teckEntities()
Using context
'Dim query = From c In context.counties Where c.stateid = ddlState.SelectedValue Select c.countyname, c.id
Dim query = From c In context.ziptaxes Where c.StateID = ddlState.SelectedValue Order By c.City Select c.City, c.ZipTaxId
query.Distinct()
ddlCity.DataSource = query.ToList()
ddlCity.DataValueField = "ziptaxid"
ddlCity.DataTextField = "City"
ddlCity.DataBind()
End Using
End If
End Sub