Sub Carica_Menu(Sender As Object, E As EventArgs) ' collegamento al db objReader = objDatabase.SelectSQL("SELECT ID,Nome FROM Tabella")
if not objReader is nothing then Dropdownlist.DataValueField = "ID" Dropdownlist.DataTextField = "Nome" Dropdownlist.DataSource = objReader Dropdownlist.DataBind()
objReader.Close
lblMessage.text=""
else
lblmessage.text="ERRORE NELLA QUERY"
end if
objReader.Close
End Sub
praticamente io ho una funzione a cui passo la query, questa funzione mi restituisce un OLEDBREADER o nothing se la query non trova nulla.