I am a newbie in asp.net, I want to ask what is more proper in terms of populating the dropdown list in asp.net? using a Datasource or using a sqldatareader and a for loop.
I am using the sqldatareader and a for loop, here is my sample code:
For i = 1 To 20
etc.CommandText = "select Classification from schemaItemDetails.AssetClassification where AC_ID = " & i & ""
Dim dr As SqlDataReader = etc.ExecuteReader
While (dr.Read())
ddoneclassification.Items.Add(dr.GetString(0))
End While
dr.Close()
Next
Is there a difference in using sqldatasource and this one?? I never use sqldatasource for populating the dropdown.