Private Sub DropDownList3_Load(ByVal sender As Object, ByVal e A
System.EventArgs) Handles DropDownList3.Load
DropDownList3.Items.Clear()
Dim ds As New ListItem()
Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Dat
Source=database.mdb" ( Change this to ur connection string)
Dim dc As New OleDbConnection(con)
Dim strSQL As String = "SELECT PurposeFunction FRO
[Contribution]" (change this to ur field name and table name)
Dim cmd As New OleDbCommand(strSQL, dc)
dc.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
While dr.Read()
ds.Text = dr(0)
If DropDownList3.Items.Contains(ds) = False Then
DropDownList3.Items.Add(dr(0))
End If
End While
dc.Close()
----------------------------------------------------------------------------------------------------------------------------------------------------
this code is not set thru dataset, but it's actually work and n
duplication! Hope this can help yo
--
le
-----------------------------------------------------------------------
lea's Profile:
http://www.msusenet.com/member.php?userid=156
View this thread:
http://www.msusenet.com/t-187044956