Hello, I've been working on this for three days now and I can't seem to get my listbox to populate...please help. I'm connecting to an sql database. Where am I going wrong?

Dim cmd As New SqlCommand("SELECT DISTINCT natureport FROM rates ORDER BY natureport", conn)
        Dim da As SqlDataReader

        conn.Open()
        da = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        da.Read()
        If da.HasRows Then
         ListBox1.Items.Add(da.Item("natureport"))
         End If
         da.Close()
         conn.Close()
Dim cmd As New SqlCommand("SELECT DISTINCT natureport FROM rates ORDER BY natureport", conn)
Dim da As SqlDataReader

conn.Open()
da = cmd.ExecuteReader(CommandBehavior.CloseConnection)
while da.Read()
   ListBox1.Items.Add(da.Item("natureport"))
end while   
da.Close()
conn.Close()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.