立足我的代碼下拉列表值我使用的數據綁定下拉列表值重複
Public Function get_type() As String
'get type
If IsPostBack = False Then
da = New OleDbDataAdapter("select (type) from prod_type", con)
da.Fill(ds, "prod_type")
ddtype.DataSource = ds
ddtype.DataTextField = "type"
ddtype.DataValueField = "type"
ddtype.DataBind()
da.Dispose()
ds.Dispose()
con.Close()
End If
我調用這個函數在頁面加載
歡迎來到堆棧溢出。如果你有問題請說明。 – naveen
你正在存儲你的DataSet f.e.在會話中? @naveen:問題是爲什麼DropDownList中的值重複。我假設DataSet沒有被清除,因爲他將它存儲在Session中,甚至存儲在Cache中。 –
@Tim Schmelter no – evigneesh