just use this code& place loaddrp() in page_load
where tablename is"table1" & field to b populated inside dropdownlist is "ID"......
Public Function loaddrp() As String
Dim str As String = "select ID from table1"
Dim con As String = ConfigurationManager.AppSettings("preeconn")
Dim com As New SqlCommand(str, New SqlConnection(con))
com.Connection.Open()
Dim ds As New SqlDataAdapter(str, con)
Dim da As SqlDataReader
'ds.Fill(da, "table1")
da = com.ExecuteReader
While da.Read
drp1.Items.Add(da("ID"))
End While
End Function
===========
regards....
preetham
Reputation Points: 5
Solved Threads: 1
Junior Poster in Training
Offline 82 posts
since Jun 2007